Skip to content

Commit

Permalink
fix(v2): make sure to import modal before opening
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Jul 31, 2020
1 parent f42edfb commit 1fc3435
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ function DocSearch(props) {

const onInput = useCallback(
(event) => {
setIsOpen(true);
setInitialQuery(event.key);
importDocSearchModalIfNeeded().then(() => {
setIsOpen(true);
setInitialQuery(event.key);
});
},
[setIsOpen, setInitialQuery],
[importDocSearchModalIfNeeded, setIsOpen, setInitialQuery],
);

useDocSearchKeyboardEvents({
Expand Down

0 comments on commit 1fc3435

Please sign in to comment.