From 888fc14672fd4acd32b64949c3cb49b59e5d5358 Mon Sep 17 00:00:00 2001 From: israelko Date: Wed, 10 Sep 2025 13:03:00 +0300 Subject: [PATCH 1/4] for wheel picker children items also pass the `testID` prop if provided --- src/components/WheelPicker/Item.tsx | 3 ++- src/components/WheelPicker/usePresenter.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/WheelPicker/Item.tsx b/src/components/WheelPicker/Item.tsx index 0b449d05e8..1bdb2ac4af 100644 --- a/src/components/WheelPicker/Item.tsx +++ b/src/components/WheelPicker/Item.tsx @@ -15,6 +15,7 @@ export interface WheelPickerItemProps { value: T; align?: WheelPickerAlign; disableRTL?: boolean; + testID?: string; } interface InternalProps extends WheelPickerItemProps { @@ -53,7 +54,7 @@ const WheelPickerItem = (props: Interna align, disableRTL } = themeProps; - + const selectItem = useCallback(() => onSelect(index), [index]); const itemOffset = index * itemHeight; const _activeColor = useRef(activeColor.toString()); diff --git a/src/components/WheelPicker/usePresenter.ts b/src/components/WheelPicker/usePresenter.ts index ad520b0947..b368d0d8f1 100644 --- a/src/components/WheelPicker/usePresenter.ts +++ b/src/components/WheelPicker/usePresenter.ts @@ -30,7 +30,7 @@ const usePresenter = ({ const extractItemsFromChildren = (): WheelPickerItemProps[] => { const items = React.Children.map(children, child => { - const childAsType: WheelPickerItemProps = {value: child?.props.value, label: child?.props.label}; + const childAsType: WheelPickerItemProps = {value: child?.props.value, label: child?.props.label, testID: child?.props.testID}; return childAsType; }); return items || []; From bb9b973bdc2b27360695b811eaf9205a50478e30 Mon Sep 17 00:00:00 2001 From: israelko Date: Wed, 10 Sep 2025 13:16:27 +0300 Subject: [PATCH 2/4] revert changes --- src/components/WheelPicker/Item.tsx | 1 - src/components/WheelPicker/usePresenter.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/WheelPicker/Item.tsx b/src/components/WheelPicker/Item.tsx index 1bdb2ac4af..1dc8813b7d 100644 --- a/src/components/WheelPicker/Item.tsx +++ b/src/components/WheelPicker/Item.tsx @@ -15,7 +15,6 @@ export interface WheelPickerItemProps { value: T; align?: WheelPickerAlign; disableRTL?: boolean; - testID?: string; } interface InternalProps extends WheelPickerItemProps { diff --git a/src/components/WheelPicker/usePresenter.ts b/src/components/WheelPicker/usePresenter.ts index b368d0d8f1..ad520b0947 100644 --- a/src/components/WheelPicker/usePresenter.ts +++ b/src/components/WheelPicker/usePresenter.ts @@ -30,7 +30,7 @@ const usePresenter = ({ const extractItemsFromChildren = (): WheelPickerItemProps[] => { const items = React.Children.map(children, child => { - const childAsType: WheelPickerItemProps = {value: child?.props.value, label: child?.props.label, testID: child?.props.testID}; + const childAsType: WheelPickerItemProps = {value: child?.props.value, label: child?.props.label}; return childAsType; }); return items || []; From 93853714e35b33e38345555ac42f88bd73974108 Mon Sep 17 00:00:00 2001 From: israelko Date: Wed, 10 Sep 2025 13:22:44 +0300 Subject: [PATCH 3/4] fix the right place --- src/components/picker/PickerPresenter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/picker/PickerPresenter.ts b/src/components/picker/PickerPresenter.ts index 482047b3c3..226a9b1575 100644 --- a/src/components/picker/PickerPresenter.ts +++ b/src/components/picker/PickerPresenter.ts @@ -8,7 +8,9 @@ export function extractPickerItems(props: PickerProps) { // @ts-expect-error handle use PickerItemProps once exist value: child?.props.value, // @ts-expect-error handle use PickerItemProps once exist - label: child?.props.label + label: child?.props.label, + // @ts-expect-error handle use PickerItemProps once exist + testID: child?.props.testID, })); return items ?? []; } From 6bf6c74ed14c5e83cb0477e7edce764fc584aee8 Mon Sep 17 00:00:00 2001 From: israelko Date: Wed, 10 Sep 2025 13:26:59 +0300 Subject: [PATCH 4/4] fix lint --- src/components/picker/PickerPresenter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/picker/PickerPresenter.ts b/src/components/picker/PickerPresenter.ts index 226a9b1575..6307c7295b 100644 --- a/src/components/picker/PickerPresenter.ts +++ b/src/components/picker/PickerPresenter.ts @@ -10,7 +10,7 @@ export function extractPickerItems(props: PickerProps) { // @ts-expect-error handle use PickerItemProps once exist label: child?.props.label, // @ts-expect-error handle use PickerItemProps once exist - testID: child?.props.testID, + testID: child?.props.testID })); return items ?? []; }