nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Checkbox onValueChange is fired twice on mobile

Open Foxhunt opened this issue 7 months ago • 4 comments
trafficstars

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

  1. open https://www.heroui.com/docs/components/checkbox#controlled in chrome
  2. open dev tools
  3. enable device toolbar
  4. set dimensions to responsive
  5. set device type to mobile
  6. 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

Foxhunt avatar Apr 07 '25 13:04 Foxhunt

+1

nextrie avatar May 11 '25 13:05 nextrie

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)

bear-bibeault avatar May 29 '25 19:05 bear-bibeault

when will they solve this issue?

cnakarimi avatar Jun 09 '25 08:06 cnakarimi

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 avatar Jun 26 '25 03:06 erwin-huang

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

wingkwong avatar Jun 26 '25 04:06 wingkwong

anyone could still reproduce the issue? I tried with chrome on latest docs and seems looks fine.

wingkwong avatar Jun 27 '25 12:06 wingkwong

It worked fine on my project as well (version 2.7.9)

erwin-huang avatar Jun 27 '25 13:06 erwin-huang

I am using tailwind v-4 so I have "@heroui/react": "^2.8.0-beta.4", is it fixed in this version too?

cnakarimi avatar Jun 29 '25 07:06 cnakarimi