Comments (2)
Your analysis looks correct. I'm also not too sure about the fix for it, but this seems like a reasonable starting place. Thank you for the very detailed issue!
from react-spectrum.
I've looked into this a little more and realized the way RAC Checkbox's <label>
and <input>
are laid out is fundamentally different than that of React Spectrum's.
To be more specific, it looks like <label>
handles all the Checkbox interactions while <input>
is hidden away visually in a RAC Checkbox, whereas the situation for a React Spectrum Checkbox is quite the opposite—<input>
is styled in a way that it sits on top of <label>
and other elements that are part of a Checkbox and handles all the interaction itself.
So because of this duality of the roles of <label>
and <input>
, I now think adding checks for HTMLLabelElement
wherever HTMLInputElement
is checked in usePress()
is a valid way to fix this issue.
Specifically in these functions:
react-spectrum/packages/@react-aria/interactions/src/usePress.ts
Lines 767 to 781 in d80999e
react-spectrum/packages/@react-aria/interactions/src/usePress.ts
Lines 876 to 890 in d80999e
react-spectrum/packages/@react-aria/interactions/src/usePress.ts
Lines 904 to 909 in d80999e
Lastly, I think we shouldn't pass pressProps
, which is baked-in in inputProps
returned from useToggle()
to the visually hidden <input>
element in a RAC Checkbox since pressProps
contains interaction-related event handlers, and said <input>
in the RAC Checkbox is not supposed to be interacted with (not sure how to efficiently filter out those props though..)
from react-spectrum.
Related Issues (20)
- iOS keyboard overlaps with inputs when using useModalOverlay hook. HOT 1
- export internal types such as StyleRenderProps, ScrollableProps, etc
- When multiple slider thumbs are visually collapsed, the thumb with the highest index captures all pointer interaction. HOT 9
- The instructions for client side routing for Tantsack Router doesn't work. HOT 3
- "milliseconds" granularity for DateField and TimeField
- [RAC] inputRef is undefined in Textfield HOT 5
- [Bug] `<SearchField />` trigger `onSubmit` when pressing Enter is used for completing IME
- Section does not apply aria label HOT 1
- ComboBox Popover doesn't update if Input position changes HOT 1
- Positioning popovers relative to a virtual element (support right-click context menus) HOT 3
- Undefined unavailableDate crash in DateRangePicker when using SSR optimized localized strings HOT 2
- MacOS - Safari - Show scroll bars always - Word wrap HOT 1
- Incorrect popover placement when using css `zoom` on `body` HOT 1
- useSelect example typescript support HOT 1
- 'TextField' focus does not change border color (TW starter kit) HOT 1
- mpg to mp4 HOT 1
- [TreeView] Expose TreeState to TreeItem? HOT 3
- React 19 support HOT 1
- MenuItem issue when target="_blank" is used HOT 1
- Warning: React does not recognize the `allowFocusWhenDisabled` prop on a DOM element. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-spectrum.