nextui
nextui copied to clipboard
[BUG] - Checkbox onValueChange is fired twice on mobile
HeroUI Version
2.7.5
Describe the bug
The onValueChange eventhandler of the Checkbox-Component is fired twice on mobile.
Once with the changes value and a second time with the previous value.
Your Example Website or App
https://www.heroui.com/docs/components/checkbox#controlled
Steps to Reproduce the Bug or Issue
- open https://www.heroui.com/docs/components/checkbox#controlled in chrome
- open dev tools
- enable device toolbar
- set dimensions to responsive
- set device type to mobile
- click/tab the checkbox
Expected behavior
The onValueChange eventhandler of the Checkbox-Component should only be fired once.
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
+1
I'm seeing this also. Some added information:
- It only appears to be happening with Chrome and Edge DevTools when in responsive display mode, regardless of device size
- It does not happen in Firefox or Safari in responsive mode
- It does not happen if the browser is resized (not using Dev Tools) to responsive widths
- It does not happen on an actual mobile device (at least not an iPhone 16 Pro)
when will they solve this issue?
when will they solve this issue?
@cnakarimi It should have been fixed in version 2.7.9.
Release Tag: https://github.com/heroui-inc/heroui/releases/tag/%40heroui%2Freact%402.7.9 • chore(docs): add missing onValueChange in CheckboxGroup by @wingkwong in https://github.com/heroui-inc/heroui/pull/5332
@erwin-huang The PR you linked was simply updating docs. I think It has nothing to do with the issue. Need to revisit this issue again with the latest version.
anyone could still reproduce the issue? I tried with chrome on latest docs and seems looks fine.
It worked fine on my project as well (version 2.7.9)
I am using tailwind v-4 so I have "@heroui/react": "^2.8.0-beta.4", is it fixed in this version too?