Skip to content
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

Merged
merged 7 commits into from
Dec 11, 2023
Merged

Long press button #66 #69

merged 7 commits into from
Dec 11, 2023

Conversation

Jojoliu66
Copy link
Contributor

No description provided.

@ddfridley
Copy link
Contributor

FYI I create this issue: codastic/react-positioning-portal#38

@ddfridley
Copy link
Contributor

@Jojoliu66 can you merge this with master and and resolve the conflicts.

Copy link
Contributor

@ddfridley ddfridley left a 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).

@Jojoliu66
Copy link
Contributor Author

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.

Copy link
Contributor

@ddfridley ddfridley left a 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,.


useEffect(() => {
if (isPortalOpen) {
const displayTime = Math.min(8, 0.1 * title.length) * 1000;
Copy link
Contributor

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.

@Jojoliu66
Copy link
Contributor Author

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,.

Sorry for the late reply, yes, I am on 8.19.4

Copy link
Contributor

@ddfridley ddfridley left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants