A current requirement in our application requires the knowledge of wether the popup of suggestions is currently open.
The full requirement is that if the pop-up is closed, I need to be able to control keyboard navigation of my form with the arrow keys.
However, if the pop-up is open, I do not want to override the arrow key nav that React-AutoSuggest has.
Would it be possible (I can write the code) to add a prop that has the following possible signature:
popupStateChanged: (isOpen: boolean) => void;
Same my problem.
I want to do this.
If popup is open and 'user' press enter then only update on Input
If popup is close and 'user' press enter at Input then Call Function
But dont have state of Popup for checking
@raybooysen @nighttiger1990
What if we passed to onKeyDown a boolean indicating whether the suggestions are visible or not:
inputProps.onKeyDown = (event, { isOpen }) => {
...
}
Would this address your use case?
Would this work for mouse events?
@moroshko
@raybooysen @nighttiger1990
What if we passed toonKeyDowna boolean indicating whether the suggestions are visible or not:inputProps.onKeyDown = (event, { isOpen }) => { ... }Would this address your use case?
That would be useful if it's still possible to get it implemented.
Most helpful comment
@raybooysen @nighttiger1990
What if we passed to
onKeyDowna boolean indicating whether the suggestions are visible or not:Would this address your use case?