Skip to content

Commit 139f601

Browse files
committed
Update type annotation in ListBox example and fix style formatting in ListBox story
1 parent 2fbcf50 commit 139f601

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/react-aria-components/docs/ListBox.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ ListBox supports custom keyboard event handling on individual items via the `onK
415415

416416
```tsx example
417417
import {useListData} from 'react-stately';
418+
import type {Key} from 'react-aria-components';
418419

419420
function Example() {
420421
let list = useListData({
@@ -427,7 +428,7 @@ function Example() {
427428
]
428429
});
429430

430-
let handleKeyDown = (key: React.Key) => (e: React.KeyboardEvent) => {
431+
let handleKeyDown = (key: Key) => (e: React.KeyboardEvent) => {
431432
if (e.key === 'Delete' || e.key === 'Backspace') {
432433
e.preventDefault();
433434
list.remove(key);

packages/react-aria-components/stories/ListBox.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ export const ListBoxWithKeyboardDelete: ListBoxStory = () => {
832832
};
833833

834834
return (
835-
<div style={{display: 'flex', flexDirection: 'column',alignItems: 'center', gap: 12}}>
835+
<div style={{display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 12}}>
836836
<div style={{padding: 12, background: '#f0f0f0', borderRadius: 4}}>
837837
Press <Keyboard>Delete</Keyboard> or <Keyboard>Backspace</Keyboard> to remove the focused item.
838838
</div>

0 commit comments

Comments
 (0)