Autocomplete triggers onSelect
when pressing Enter while beforeAction
is disabled and no option is in focus
#11983
Labels
Bug
Something is broken and not working as intended in the system.
Summary
When the
beforeAction
for Autocomplete is disabled, pressing Enter on the keyboard still triggers theonSelect
callback, but with thecontent
of thebeforeAction
minus the last character as theselected
option. Subsequent presses of the Enter key select and deselect this value.In the following reduced test case, the
beforeAction
is disabled if theinputValue
is found among the labels of the Autocomplete optionsExpected behavior
Pressing the Enter key while the
beforeAction
is disabled and no option is in focus should do nothing. Perhaps if thebeforeAction
becomes disabled and there are options shown, the first option should receive focus?Actual behavior
Demo of problem
06-01-hrggv-skuuq.mp4
Steps to reproduce
Link to sandbox
Vinyl
)beforeAction
becomes disabled (expected)beforeAction
does nothing (expected)onSelect
callback with thecontent
of thebeforeAction
minus the last character as theselected
value (unexpected)console.log
s to better demonstrate thisselected
Are you using React components?
No
Polaris version number
12
Browser
Chrome
Device
M1 MacBook Pro
The text was updated successfully, but these errors were encountered: