@lotics/ui 1.13.1 → 1.13.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/picker.tsx +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/ui",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tokens": "./src/tokens.ts",
package/src/picker.tsx CHANGED
@@ -109,7 +109,12 @@ function StandardPicker<T extends string>(props: PickerProps<T, false>) {
109
109
  placeholder={placeholder}
110
110
  enabled={!disabled}
111
111
  >
112
- {(!value || includeEmptyOption) && <RNPicker.Item label="" value="" />}
112
+ {(!value || includeEmptyOption) && (
113
+ // Show the placeholder as the empty option (the standard
114
+ // `<option value="" selected>Placeholder</option>` pattern) so a
115
+ // native select hints what to choose.
116
+ <RNPicker.Item label={!value ? (placeholder ?? "") : ""} value="" />
117
+ )}
113
118
  {options.map((option) =>
114
119
  option ? (
115
120
  <RNPicker.Item
@@ -259,6 +264,13 @@ function PickerTrigger<T extends string>({
259
264
  <Pressable
260
265
  ref={ref}
261
266
  testID={testID}
267
+ // Without a role this Pressable renders as an unfocusable <div> on web —
268
+ // the trigger drops out of the tab order and Enter/Space can't open it.
269
+ // `button` makes it tab-focusable and maps keyboard activation to onPress;
270
+ // `expanded` announces open/closed to assistive tech. The accessible name
271
+ // comes from the visible selection/placeholder text below.
272
+ accessibilityRole="button"
273
+ accessibilityState={{ expanded: open, disabled }}
262
274
  style={[
263
275
  styles.pressable,
264
276
  open && !enableSearch && styles.opened,