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

[BUG] - Button onPress will trigger more events. #1934

Closed
jim-king-2000 opened this issue Nov 9, 2023 · 5 comments
Closed

[BUG] - Button onPress will trigger more events. #1934

jim-king-2000 opened this issue Nov 9, 2023 · 5 comments
Labels
🐛 Type: Bug Something isn't working

Comments

@jim-king-2000
Copy link

jim-king-2000 commented Nov 9, 2023

NextUI Version

2.2.8

Describe the bug

When we click the "back" button to route back to the previous page, the same click will trigger the link (on the same position with respect to the "back" button) on the previous page (destination page).

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Open https://[cache-hit-shanghai.github.io/jujiuipcappui/en/nextui/my/ on mobile chrome.
  2. Click "About" and go to "About" page, then click "back" icon on the "About" page to go back.
  3. Notice it will be redirected to the login page.

Notes:

  1. https://github.com/Cache-Hit-Shanghai/jujiuuicomponents/blob/bfc0b1688799fdd4f11960c4df617abb48df182a/nextui/core/core-ui.js#L7 is the code for the back button.
  2. If we open the link on PC browser, it works well.
  3. The back button handles onPress event. If we change it to onClick, it works well.
  4. I tried to make a smallest reproduce, but I failed. This bug only exists in this project.

Expected behavior

Just go back to the previous page.

Screenshots or Videos

No response

Operating System Version

Android 13

Browser

Chrome

@jim-king-2000 jim-king-2000 added the 🐛 Type: Bug Something isn't working label Nov 9, 2023
@hamishtaplin
Copy link

This is a really annoying issue with Buttons - it's pretty common that a Button press will trigger a UI change that results in another Button appearing in the same position and then the mouseup event gets caught by the second Button and triggers the onPress again.

@jim-king-2000
Copy link
Author

It's pretty weird. The two buttons interested are NOT even on the same page. Besides, if the button underneath is a common button processing onPress (not a Link), it works well. So, is it a bug of nextui or not?

@jim-king-2000
Copy link
Author

It can't be reproduced on v2.2.9.

@friday-sds
Copy link

I believe This issue is from react-aria. adobe/react-spectrum#5802 . @jim-king-2000 this issue is still happening . I am using next ui 2.2.9

@jim-king-2000
Copy link
Author

I believe This issue is from react-aria. adobe/react-spectrum#5802 . @jim-king-2000 this issue is still happening . I am using next ui 2.2.9

Yeah, I think so. What should we do? Fire another issue for react-aria?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants