You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because a read-only field cannot have it's value changed by a user interaction, required does not have any effect on inputs with the readonly attribute also specified.
Expected behavior
When required prop is passed to Listbox/ListboxInput, without selecting value in said Listbox form submission should not happen; instead, native form error message should pop up and field should be focused.
馃悰 Bug report
Current Behavior
While
required
prop is correctly passed to ListboxInput, the presence ofreadOnly
prop pretty much cancels it.reach-ui/packages/listbox/src/index.tsx
Lines 311 to 312 in 0c21334
As per MDN article "HTML attribute: readonly":
Expected behavior
When
required
prop is passed to Listbox/ListboxInput, without selecting value in said Listbox form submission should not happen; instead, native form error message should pop up and field should be focused.Reproducible example
https://codesandbox.io/s/reach-listbox-validation-6dikr7
Suggested solution(s)
Your environment
The text was updated successfully, but these errors were encountered: