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] - Interactive Elements Not Responding on iOS After Updating to NextUI 2.6.0 #4292

Closed
scarrascoalvarez opened this issue Dec 9, 2024 · 22 comments · Fixed by #4322 or #4323
Closed
Assignees
Labels
🐛 Type: Bug Something isn't working
Milestone

Comments

@scarrascoalvarez
Copy link

scarrascoalvarez commented Dec 9, 2024

NextUI Version

2.6.0

Describe the bug

After updating to NextUI 2.6.0, interactive elements such as cards, buttons, and clickable components stopped working on iOS devices when navigating through the web application. Tapping these elements does not trigger any action or event, making the interface non-functional on affected devices.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

1.	Update the project to NextUI 2.6.0.
2.	Deploy the application or run it locally.
3.	Access the web app on an iOS device (Safari/Chrome).
4.	Attempt to interact with buttons, cards, or clickable elements.

Expected behavior

Interactive elements such as buttons and cards should respond to taps or clicks as expected, triggering the correct actions/events.

Screenshots or Videos

Operating System Version

iOS

Browser

Safari

Copy link

linear bot commented Dec 9, 2024

@scarrascoalvarez scarrascoalvarez changed the title [BUG] - YOUR_ISSUE_TITLE_HERE_REPLACE_ME [BUG] - Interactive Elements Not Responding on iOS After Updating to NextUI 2.6.0 Dec 9, 2024
@bckd00r
Copy link

bckd00r commented Dec 9, 2024

i am having same issue on android too

@jrgarciadev
Copy link
Member

We're investigating this issue, fix should be out soon

@jrgarciadev jrgarciadev added the 🐛 Type: Bug Something isn't working label Dec 9, 2024 — with Linear
@jimmailcamp
Copy link

It occurs when using buttons in Portals on ios

@bckd00r
Copy link

bckd00r commented Dec 9, 2024

Small clarifacition about issue, if you change from onclick to onpress and remove preventdefault issue is disappears but for some components still continues... @jimmailcamp @scarrascoalvarez @sudongyuer

@sudongyuer
Copy link
Member

sudongyuer commented Dec 10, 2024

Guys, @scarrascoalvarez @jimmailcamp @bckd00r have you tried use onPress instead of onClick ?

@jimmailcamp
Copy link

Why is this necessary tho?

@bckd00r
Copy link

bckd00r commented Dec 10, 2024

Guys, @scarrascoalvarez @jimmailcamp @bckd00r have you tried use onPress instead of onClick ?

yes, i have tried onpress and it's working now but why onClick not working on mobile devices tho?

@sudongyuer
Copy link
Member

Why is this necessary tho?

This is just a temporary solution, will fix it soon

@bckd00r
Copy link

bckd00r commented Dec 10, 2024

Why is this necessary tho?

This is just a temporary solution, will fix it soon

thank you for quick answer i'm very glad to hear that gonna be fixed soon <3

@jimapl
Copy link

jimapl commented Dec 10, 2024

Glad!
Dont get me wrong, just out of interest I meant. What would cause this to happen? Trying to understand is all:)

@jrgarciadev
Copy link
Member

Hey guys please test this in the v2.6.7

@sudongyuer
Copy link
Member

Hey guys please test this in the v2.6.7

Not woking, v2.6.7 just solve the ripple issue. I'v already found the reason, will make PR soon.

@jrgarciadev
Copy link
Member

jrgarciadev commented Dec 10, 2024

We've deprecated onClick in favor of onPress to align with React Aria's accessibility and compatibility standards. You can read more about why this change was made here: Building a Button, Part 1.

Note that React Aria team already removed the onClick event but we managed to keep it in our implementations at least until the next minor version, you'll need to update your code to use onPress for all interactive elements instead of the onClick event.

This will fix the issue on iOS & Android devices and ensure proper functionality

Pull request: #4322

@JRetza
Copy link

JRetza commented Dec 15, 2024

this is one of the more ridiculous things i think i've seen in 30 years of programming. if this isn't a breaking change - what is??

@JRetza
Copy link

JRetza commented Dec 15, 2024

specifically which nextui components require onPress and which still use onClick? it seems Inputs and other items still use onClick so not only is this a big pain in the ass but now there's no consistency between components. get it together guys and do a better job.

@itorz7
Copy link

itorz7 commented Dec 23, 2024

Why do some use onPress and some use onClick?
adding more chaos

@wingkwong
Copy link
Member

@JRetza

specifically which nextui components require onPress and which still use onClick?

For the following interactive elements, you should use onPress to align with React Aria's accessibility and compatibility standards. onClick event is still there for these components at this moment until next minor version. However, please note that using onClick will cause some issues on iOS & Android devices.

  • AccordionItem
  • Button
  • Card
  • Link
  • ListboxItem
  • MenuItem

For other components, they accept onClick.

@itorz7

Why do some use onPress and some use onClick?
adding more chaos

We understand this may cause the inconvenience. Please note that this is the decision made by the react-aria team. We need to follow the same approach to avoid incompatibility. You may check out why here if you're interested.

@Jsox
Copy link

Jsox commented Dec 24, 2024

Using Button as="Link" adds warning to console too. With no onPress or onClick attribute given.

@wingkwong
Copy link
Member

@Jsox that was introduced internally. we're aware and working of it. you may simply ignore that.

@bsodmike
Copy link

bsodmike commented Jan 4, 2025

Are everyone suppressing this [Next UI] [useLink]: onClick is deprecated, please use onPress instead warning for now? Tested with the latest release in Chrome.

@wingkwong
Copy link
Member

@bsodmike let's track in #4493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment