-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Issue summary
OnBlur doesn't happen after interacting with the number spinners without first clicking inside the field itself. This is an issue when it comes to field/form validation or simply updating the state/fields with the final values on the blur event.
Expected behavior
Users should interact with a number field in any way, either via the spinners or direct key input, and trigger the onBlur event for that field after interacting with any other element as you would expect.
Actual behavior
Any interaction with other elements following a key input into a number field triggers the onBlur for that field correctly as focus shifts. If incrementing or decrementing a value with the spinners, however, the onBlur event is never triggered, and that field, including any other number fields that have been used to increment/decrement values, will remain focused. In order to remove the focus, users have to click inside the textbox, then click out of it.
Steps to reproduce the problem
- Add the <Textfield type="number" ... > component to a page.
- Run in the browser and interact with the input as described above, i.e both key input and spinners.
- Note how the focus remains after interaction with spinners only until you click back inside the field, then click back out.
Specifications
- Are you using the React components? (Y/N): Y
- Polaris version number: Both 9.15.0 and 9.19.0
- Browser: Firefox, Chrome, Edge, Safari
- Device: Desktop
- Operating System: macOS Big Sur 11.5.2