react-spectrum
react-spectrum copied to clipboard
Add native change event for hiddenSelect
Closes #6217
✅ Pull Request Checklist:
- [x] Included link to corresponding React Spectrum GitHub Issue.
- [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
- [x] Filled out test instructions.
- [ ] Updated documentation (if it already exists for this component).
- [ ] Looked at the Accessibility Practices for this feature - Aria Practices
📝 Test Instructions:
yarn jest packages/@react-aria/select/test/HiddenSelect.test.tsx -t "should trigger onChange"
🧢 Your Project:
Looks like one of the Picker tests is failing. Have you looked into it?
Will look into it this weekend yeah.
Been struggling to find out why this line causes that Picker test to fail:
https://github.com/adobe/react-spectrum/blob/d7b7b351ac71cfab57949d0af1882ba2951c7dc6/packages/%40react-aria/select/src/HiddenSelect.tsx#L128
I've added a story in the Picker story where you can debug the test. I cannot reproduce it manually. Will do another attempt later on.
Another thing i've realised is that in the HiddenSelect there will rendered a hidden input instead of a Native Select if there are more then 300 options. Will still have to cover this as well.
https://github.com/adobe/react-spectrum/blob/d7b7b351ac71cfab57949d0af1882ba2951c7dc6/packages/%40react-aria/select/src/HiddenSelect.tsx#L135-L168