Closed noahkconley closed 7 years ago
@gallardo1226 That seems like an oversight that the input does not focus while fetching occurs. I will take a look
Much appreciated!
@gallardo1226 Thanks for filing the issue. Should be addressed in the latest https://github.com/alsoscotland/react-super-select/tree/v1.0.8
Thanks for addressing it so quickly!
I'm trying to configure my ajax search so that the searchable input element autofocuses when the dropdown opens. This works perfectly for non-ajax search, or if the ajax dropdown is opened a second time with the data already fetched, but it doesn't seem to work on the initial data fetch.
At initial state there is no
lastUserSelectedOption
, so_setFocusOnOpen
passes to_moveFocusDown
, which returns because_needsAjaxFetch
is true. In_fetchDataViaAjax
, it doesn't move the focus to the search field unlessopenOnMount
andfocusOnMount
are both true.Is there any way to configure this now? If not, could there be functionality to either move the focus during or after an ajax call, or if the
fetchAjaxData
function is defined, call it once the component is mounted?