Skip to content

Commit f4697d5

Browse files
committed
fix: include onSelect callback in InputSelect selected documentation example
1 parent f874afd commit f4697d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build.washingtonpost.com/docs/components/input-search.mdx

+10-1
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,18 @@ export default function Example() {
563563
const [term, setTerm] = useState("");
564564
const results = searchCities(term);
565565

566+
const [selected, setSelected] = useState("");
567+
566568
return (
567569
<Box css={{ width: "300px", height: "340px" }}>
568-
<InputSearch.Root aria-label="Example-Search" openOnFocus>
570+
<Box css={{ marginBlockEnd: "$100" }}>
571+
<strong>Selected value:</strong> {selected}
572+
</Box>
573+
<InputSearch.Root
574+
aria-label="Example-Search"
575+
openOnFocus
576+
onSelect={(value) => setSelected(value)}
577+
>
569578
<InputSearch.Input
570579
name="city"
571580
id="city"

0 commit comments

Comments
 (0)