Skip to content

Commit

Permalink
Fix bug where empty string is a valid focusKey
Browse files Browse the repository at this point in the history
  • Loading branch information
vovacodes committed Sep 2, 2021
1 parent 12255c9 commit 5ffc39b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-sunbeam/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-sunbeam",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "Spatial navigation and focus management for React",
"keywords": [
"spatial-navigation",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-sunbeam/src/focus/FocusableNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class FocusableNode implements IFocusableNode {
customGetPreferredChild?: CustomGetPreferredChildFn
lock: Direction[] | Direction | undefined
}) {
focusKey = focusKey ?? `focusable:${randomId()}`
focusKey = focusKey || `focusable:${randomId()}`
this.focusKey = focusKey
this.path = [...parentPath, focusKey]
this.getBoundingBox = getBoundingBox
Expand Down

0 comments on commit 5ffc39b

Please sign in to comment.