Skip to content

Commit

Permalink
Update setTimeout function
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyichen committed Jan 31, 2022
1 parent c3002b1 commit 36ac728
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/js/widgets/search_bar/search_bar_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ define([

// on close, move focus to search bar. If we change page layout, may have to change this
// delayed to handle user click on a link in the description before closing
$select2Instance.on('close', async () => {
$select2Instance.on('close', () => {
document.getElementById('query-search-input').focus();
await new Promise((resolve) => setTimeout(resolve, 10));
document.getElementsByClassName('search-term-popover')[0].remove();
setTimeout(() => {
document.getElementsByClassName('search-term-popover')[0].remove();
}, 10);
});

const platform = bowser.parse(window.navigator.userAgent).platform.type;
Expand Down

0 comments on commit 36ac728

Please sign in to comment.