@delacour/react-native-ui 0.8.0 → 0.8.1-alpha.20261106131858
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": "@delacour/react-native-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-alpha.20261106131858",
|
|
4
4
|
"description": "React Native UI components — Uniwind, Reanimated, Gesture Handler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -186,8 +186,8 @@
|
|
|
186
186
|
"expo-blur": ">=15",
|
|
187
187
|
"@maplibre/maplibre-react-native": "^11.5.0",
|
|
188
188
|
"@central-icons-react-native/round-outlined-radius-1-stroke-1.5": "^1.1",
|
|
189
|
-
"@delacour/react-native-bottom-sheet": "
|
|
190
|
-
"@delacour/react-native-charts": "
|
|
189
|
+
"@delacour/react-native-bottom-sheet": "0.8.1-alpha.20261106131858",
|
|
190
|
+
"@delacour/react-native-charts": "0.8.1-alpha.20261106131858",
|
|
191
191
|
"@legendapp/list": ">=3.3",
|
|
192
192
|
"react-native-skia": ">=3.9.0",
|
|
193
193
|
"expo-linear-gradient": ">=15",
|
|
@@ -142,6 +142,9 @@ engine. An app that imports no picker still never resolves it.
|
|
|
142
142
|
- **Read-only looks normal and never opens.** The trigger stays enabled for a
|
|
143
143
|
screen reader — it is not disabled, it is fixed — with no press feedback, and
|
|
144
144
|
`open` refuses.
|
|
145
|
+
- **An open sheet locks with the select.** Turn the select disabled or read-only
|
|
146
|
+
while its sheet is open and every row is announced disabled, and a press that
|
|
147
|
+
still lands changes nothing — the value and `onValueChange` stay put.
|
|
145
148
|
- **The trigger is a button.** React Native has no combobox role that works on
|
|
146
149
|
both platforms, so it is `button` with the choice as its `accessibilityValue`,
|
|
147
150
|
`expanded` in its state, and a hint. Rows are `radio` or `checkbox` with
|
|
@@ -156,6 +156,21 @@ describe("Select single", () => {
|
|
|
156
156
|
expect(screen.getByRole("radio", { name: "Designer" })).toBeOnTheScreen();
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
+
test.each([
|
|
160
|
+
["disabled", { isDisabled: true }],
|
|
161
|
+
["read-only", { isReadOnly: true }],
|
|
162
|
+
] as const)("an open sheet locks its options once the select turns %s", async (_, lock) => {
|
|
163
|
+
const onValueChange = jest.fn();
|
|
164
|
+
const view = await renderSelect({ isOpen: true, onValueChange });
|
|
165
|
+
await view.rerender(
|
|
166
|
+
<Select isOpen onValueChange={onValueChange} options={OPTIONS} placeholder="Choose" testID="select" {...lock} />
|
|
167
|
+
);
|
|
168
|
+
const designer = screen.getByRole("radio", { name: "Designer" });
|
|
169
|
+
expect(designer).toBeDisabled();
|
|
170
|
+
await tap(designer);
|
|
171
|
+
expect(onValueChange).not.toHaveBeenCalled();
|
|
172
|
+
});
|
|
173
|
+
|
|
159
174
|
test("pressing the chosen row again keeps it and closes, without reporting", async () => {
|
|
160
175
|
const onValueChange = jest.fn();
|
|
161
176
|
await renderSelect({ defaultValue: "designer", onValueChange });
|
|
@@ -190,7 +190,10 @@ function SelectRoot(props: SelectProps): ReactElement {
|
|
|
190
190
|
const toggleOptions: SelectToggleOptions =
|
|
191
191
|
mode === "multiple" ? { max: maxSelected, mode: "multiple" } : { isClearable, mode: "single" };
|
|
192
192
|
|
|
193
|
+
// The sheet can stay open while the select turns disabled or read-only, so
|
|
194
|
+
// the rows lock with it and a press that slips through changes nothing.
|
|
193
195
|
const toggle = (value: string) => {
|
|
196
|
+
if (!canOpen) return;
|
|
194
197
|
const result = toggleSelection(selected, value, toggleOptions);
|
|
195
198
|
if (result.change === "blocked" || result.change === "limit-reached") playHaptic("warning");
|
|
196
199
|
if (result.change !== "unchanged" && result.change !== "blocked") setSelected(result.selected);
|
|
@@ -266,7 +269,7 @@ function SelectRoot(props: SelectProps): ReactElement {
|
|
|
266
269
|
return (
|
|
267
270
|
<SelectOptionRow
|
|
268
271
|
description={limitDescription}
|
|
269
|
-
isDisabled={state.isDisabled}
|
|
272
|
+
isDisabled={state.isDisabled || !canOpen}
|
|
270
273
|
isSelected={isSelected}
|
|
271
274
|
mode={mode}
|
|
272
275
|
onPress={toggle}
|