Skip to content

Commit

Permalink
fix: dataset of null error
Browse files Browse the repository at this point in the history
08:53:50   return node.dataset && node.dataset.focusGuard;
08:53:50               ^
08:53:50
08:53:50 TypeError: Cannot read property 'dataset' of null
08:53:50     at isGuard
  • Loading branch information
pgarciacamou committed Apr 24, 2020
1 parent 1d3bc04 commit 7cb428b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/focusMerge.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const findAutoFocused = autoFocusables => node => (
autoFocusables.indexOf(node) >= 0
);

const isGuard = node => (node.dataset && node.dataset.focusGuard);
const isGuard = node => (node && node.dataset && node.dataset.focusGuard);
const notAGuard = node => !isGuard(node);

export const newFocus = (innerNodes, outerNodes, activeElement, lastNode, autoFocused) => {
Expand Down

0 comments on commit 7cb428b

Please sign in to comment.