From 5f72e5049a0bb183a6f68a14d7d34fa5549b7bab Mon Sep 17 00:00:00 2001 From: venkatesh paithireddy Date: Thu, 31 Oct 2024 19:55:20 +0530 Subject: [PATCH 1/3] added accessibility id as a locator (#896) * added accessibility id as a locator * addressed lint checks --- js/SegmentedControlTab.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/SegmentedControlTab.js b/js/SegmentedControlTab.js index db2ca25..2469b8a 100644 --- a/js/SegmentedControlTab.js +++ b/js/SegmentedControlTab.js @@ -13,6 +13,7 @@ import { TouchableOpacity, View, useColorScheme, + Platform, } from 'react-native'; import type {FontStyle, ViewStyle} from './types'; @@ -95,7 +96,12 @@ export const SegmentedControlTab = ({ accessibilityHint={accessibilityHint} accessibilityRole="button" accessibilityState={{selected: selected, disabled: !enabled}} - testID={testID}> + testID={testID} + accessible={true} + accessibilityLabel={Platform.select({ + android: testID, + ios: typeof value === 'string' ? value : testID, + })}> {typeof value === 'number' || typeof value === 'object' ? ( From 36b0cb1be07bc4f28591710c6639b9bc8d279cc6 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sun, 10 Nov 2024 16:32:19 +0900 Subject: [PATCH 2/3] fix: publish ci (#898) * fix: publish ci * Fix: lint --- .github/workflows/publish.yml | 2 +- js/SegmentedControl.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index df58360..1b90d05 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18] + node-version: [20] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/js/SegmentedControl.js b/js/SegmentedControl.js index 903f278..9e24486 100644 --- a/js/SegmentedControl.js +++ b/js/SegmentedControl.js @@ -84,7 +84,7 @@ const SegmentedControl = ({ if (ref.current) { ref.current.measure((_x, _y, width) => updateSegmentWidth(width)); } - }, [values]); + }, [values, updateSegmentWidth]); return ( Date: Wed, 13 Nov 2024 23:27:24 +0900 Subject: [PATCH 3/3] 2.5.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6aa7dd5..1252c56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-segmented-control/segmented-control", - "version": "2.5.5", + "version": "2.5.6", "description": "React Native SegmentedControlIOS library", "main": "js/index.js", "types": "index.d.ts",