Skip to content

Commit a1cb76e

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

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/demo/src/apps/SettingsMenu/Slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react"
22
import { useState } from "react"
33
import { motion } from "framer-motion"
4-
import { Direction, Focusable, SyntheticGamepadKeyEvent } from "react-sunbeam"
4+
import { Direction, Focusable } from "react-sunbeam"
55
import { Colors, Typography } from "../../styles.js"
66
import { isCancel, isLeft, isRight, isSelect } from "../../keyPressUtils.js"
77

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)