@vendure-io/ui 2.0.0-beta.13 → 2.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure-io/ui",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"description": "React component library for Vendure, built on shadcn/ui and Tailwind v4",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://github.com/vendurehq/design/tree/main/packages/ui",
|
|
@@ -137,6 +137,24 @@ function ComboboxFreeText<T extends ComboboxFreeTextItem = ComboboxFreeTextItem>
|
|
|
137
137
|
placeholder={placeholder}
|
|
138
138
|
disabled={disabled}
|
|
139
139
|
aria-invalid={invalid || undefined}
|
|
140
|
+
// Base UI only requests open on a keystroke; for pick-or-create
|
|
141
|
+
// fields the suggestions should also show on focus/click so a small
|
|
142
|
+
// known option set is discoverable without typing. The
|
|
143
|
+
// `items.length > 0` gate on `open` keeps an empty popup from
|
|
144
|
+
// flashing when there is nothing to pick.
|
|
145
|
+
onFocus={() => setOpen(true)}
|
|
146
|
+
onClick={() => setOpen(true)}
|
|
147
|
+
// Enter has a local meaning here — commit the highlighted suggestion
|
|
148
|
+
// or keep the typed text — so it must never double as the browser's
|
|
149
|
+
// implicit form submission (Base UI deliberately lets Enter fall
|
|
150
|
+
// through to submit when nothing is highlighted). preventDefault
|
|
151
|
+
// cancels only the native submit; Base UI's own Enter handling runs
|
|
152
|
+
// regardless, since merged handlers ignore defaultPrevented.
|
|
153
|
+
onKeyDown={(event) => {
|
|
154
|
+
if (event.key === 'Enter') {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
}
|
|
157
|
+
}}
|
|
140
158
|
/>
|
|
141
159
|
{loading ? (
|
|
142
160
|
<InputGroupAddon align="inline-end">
|