Skip to content

Commit 5ffc39b

Browse files
committed
Fix bug where empty string is a valid focusKey
1 parent 12255c9 commit 5ffc39b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react-sunbeam/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-sunbeam",
3-
"version": "2.0.0-beta.2",
3+
"version": "2.0.0-beta.3",
44
"description": "Spatial navigation and focus management for React",
55
"keywords": [
66
"spatial-navigation",

packages/react-sunbeam/src/focus/FocusableNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class FocusableNode implements IFocusableNode {
3131
customGetPreferredChild?: CustomGetPreferredChildFn
3232
lock: Direction[] | Direction | undefined
3333
}) {
34-
focusKey = focusKey ?? `focusable:${randomId()}`
34+
focusKey = focusKey || `focusable:${randomId()}`
3535
this.focusKey = focusKey
3636
this.path = [...parentPath, focusKey]
3737
this.getBoundingBox = getBoundingBox

0 commit comments

Comments
 (0)