@@ -31,7 +31,7 @@ All props accepted by `VStack` and `HStack`:
3131 focused, // boolean (controlled — omit for uncontrolled)
3232 onFocus, // () => void
3333 onBlur, // () => void
34- onKeyPress, // (key: string) => void
34+ onKeyPress, // (key: string) => boolean | void — return false to keep bubbling
3535 }
3636 ```
3737
@@ -102,7 +102,7 @@ Button("✕", { onClick: handleClose, focusable: false });
102102
103103 ### Select (filterable list)
104104
105-Select props: `items`, `onSelect`, `placeholder` (default `"type to filter..."`), `maxVisible` (default `10`), `indicator` (default `"›"`), `highlightColor` (default `"cyan"`), `onKeyPress` (receives unhandled keys), plus container/style props: `width`, `height`, `flex`, `fgColor`, `bgColor`, `focused`, `focusable`, `onFocus`, `onBlur`, `focusStyle`.
105+Select props: `items`, `onSelect`, `placeholder` (default `"type to filter..."`), `maxVisible` (default `10`), `indicator` (default `"›"`), `highlightColor` (default `"cyan"`), `onKeyPress` (composed with internal handler), plus container/style props: `width`, `height`, `flex`, `fgColor`, `bgColor`, `focused`, `focusable`, `onFocus`, `onBlur`, `focusStyle`.
106106
107107 ```ts
108108 const mySelect = Select({
@@ -113,18 +113,22 @@ const mySelect = Select({
113113 },
114114 placeholder: "search fruits...",
115115 maxVisible: 8,
116- onKeyPress: (key) => {
117- // Receives keys the Select doesn't handle (modifiers, etc.)
118- if (key === "ctrl+q") {
119- cel.stop();
120- process.exit();
121- }
122- },
123116 });
124117
125-// Inside cel.viewport — call each render to get the current node tree
118+// Select returns false for unrecognized keys, so they bubble to root.
126119 cel.viewport(() =>
127- VStack({ height: "100%" }, [Text("Pick a fruit:"), mySelect()]),
120+ VStack(
121+ {
122+ height: "100%",
123+ onKeyPress: (key) => {
124+ if (key === "ctrl+q") {
125+ cel.stop();
126+ process.exit();
127+ }
128+ },
129+ },
130+ [Text("Pick a fruit:"), mySelect()],
131+ ),
128132 );
129133
130134 // Reset state programmatically