Autosuggest: use something other than state.dropDownItems.length > 0
to filter document clicks
#2510
Labels
state.dropDownItems.length > 0
to filter document clicks
#2510
In #1732 I noticed
it seems this is happening because we have
state.dropDownItems.length > 0
inparagon/src/Form/FormAutosuggest.jsx
Line 115 in 13b7488
where we are handling all clicks on the document
if we remove
state.dropDownItems.length > 0
and instead just haveinteracting with any autosuggest component on the docs page causes error states in the others
I believe the intention here is to not set the error state on components other than the one the user is interacting with. This implies that
state.dropDownItems.length > 0
is being used to mean "this is the autosuggest component the user is interacting with right now."In the case where we have entered text that filters the dropdownitems down to a length of zero, the component behaves as if it is not the one the user is interacting with, and doesn't show an error.
We should not rely on
state.dropDownItems.length > 0
to mean "this is the autosuggest component the user is interacting with right now," as it is possible to filter thedropDownItems
down to a length of zero while interacting with the component.The text was updated successfully, but these errors were encountered: