Skip to content

Commit

Permalink
Fix error caused when bringFocusInside is called outside an event han…
Browse files Browse the repository at this point in the history
…dler (#1022)
  • Loading branch information
colinlohner committed Sep 14, 2020
1 parent 3a4f589 commit 90ca5a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/popover/src/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Popover = memo(
* https://github.com/palantir/blueprint/blob/release/2.0.0/packages/core/src/components/overlay/overlay.tsx
*/
const bringFocusInside = useCallback((e) => {
if(isShown) {
if(isShown && e) {
e.preventDefault()
}
// Always delay focus manipulation to just before repaint to prevent scroll jumping
Expand Down

0 comments on commit 90ca5a2

Please sign in to comment.