-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long press button #66 #69
Conversation
FYI I create this issue: codastic/react-positioning-portal#38 |
@Jojoliu66 can you merge this with master and and resolve the conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, and now that I've interacted with it I realize something.
The use case for long press is when someone is using the button on their phone, and doesn't get a hover option.
When they long press the button, they will probably be covering up a lot of area with their finger and won't be able to read it.
So:
- On long press, hold the title text there for Min(8, 0.1 * title.length) seconds before releasing it.
Also,
- Please make the outer tag a span rather than a div. (buttons can be placed inline).
Hi David, should we hold the title text before or after people release the button? Because I think the title should be held there after people release it, in case they want to read it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment in the code. Also there is a big change to package-lock.json. I am wondering if you we are using the same version of npm. I'm on 8.19.4. If you are on something else, please remove package-json and check it out form master. If your are on 8.19.4 then lets discuss.
Thanks,.
app/components/button.jsx
Outdated
|
||
useEffect(() => { | ||
if (isPortalOpen) { | ||
const displayTime = Math.min(8, 0.1 * title.length) * 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a difference. When I long click, the text appears. When I let go of the click, the text goes away immediately. The idea was that the text would remain visible so it could be read after moving your finger out of the way.
Also, I know I said min - but it may need to be Math.max - we want the larger number. But, it's not even holding for 8 secconds.
Sorry for the late reply, yes, I am on 8.19.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Thanks for your contribution.
No description provided.