-
-
Notifications
You must be signed in to change notification settings - Fork 306
Open
Labels
component: number fieldChanges related to the number field component.Changes related to the number field component.
Description
Bug report
Current behavior
In some scenarios when submitting a form with Number Field component in it, the following console warning appears and form submit event is not triggered:
Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: <input>
Ancestor with aria-hidden: <input>
Component is used with following format settings:
format={{
style: 'currency',
currency: 'EUR',
currencySign: 'standard',
currencyDisplay: 'symbol',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}}
A way to reproduce
- Set up a basic HTML
<form>withNumber Field(withFieldcomponent wrapper in my case) in it and<button type="submit">. - Input some random number, e.g.
12. - Click somewhere outside the input.
- The input gets formatted to
12,00 €. - Comeback to input and edit cents, e.g.
12,33 €. - Try to submit form, submit event is not triggered and above warning appears in browser console.
Expected behavior
Editing Number Field component value should not block form submission
Possible solution
Use inert instead of aria-hidden="true" on "mirror" input.
Base UI version
v1.0.0
Which browser are you using?
Google Chrome 143.0.7499.110
Which OS are you using?
Mac OS Sequoia 15.7.2
Metadata
Metadata
Assignees
Labels
component: number fieldChanges related to the number field component.Changes related to the number field component.