-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form.Autosuggest
error states and freeform text
#1732
Comments
after discussion in the paragon working group meeting, moving forward we should:
edit: more notes from meeting notes
|
Thanks for bringing the next steps back into this issue, @brian-smith-tcril :) |
Form.Autosuggest
unexplained/undefined behaviorForm.Autosuggest
error states and freeform text
It seems this is mostly well enough defined for work, but it'd be good to get a little extra clarification on how to handle error states. We have noted
and
so if I'm understanding this correctly, once the user has left the control
|
Discussed in the Paragon WG https://openedx.atlassian.net/wiki/spaces/BPL/pages/3819765775/2023-07-19+Meeting+notes Implement different error states when no options match the entered text vs when there are options that match the entered text but none were selected. In the context of the field not being required, the suggestion was to recommend clearing the input when no options match, and choosing a selection when there are valid options. |
re:
it seems this is happening because of paragon/src/Form/FormAutosuggest.jsx Line 115 in 13b7488
if if (parentRef.current && !parentRef.current.contains(e.target)) { error states appear on multiple autosuggest components on the docs page. This implies that edit: made this into its own issue #2510 |
I believe this was addressed by #2510. If there's something in here that wasn't covered by that it can be reopened. |
originally posted on slack
while investigating this, i noticed an oddity with
handleClickOutside
paragon/src/Form/FormAutosuggest.jsx
Lines 111 to 121 in 81f746f
being called even when clicking inside the control, which makes sense because it's added as a listener here
paragon/src/Form/FormAutosuggest.jsx
Lines 137 to 145 in 81f746f
i also looked into how other autosuggest components handle error states
with https://mui.com/material-ui/react-autocomplete/ there are ways to configure the component to allow/prevent arbitrary text (see https://mui.com/material-ui/react-autocomplete/#controlled-states and https://mui.com/material-ui/react-autocomplete/#controlled-states)
it's not clear how much of this functionality is desired, and what the scope of this component should be
blocked by #2510
Tasks
The text was updated successfully, but these errors were encountered: