Skip to content

Commit 23b0805

Browse files
Fix issue with iOS 26 and setting the ios_backgroundColor
1 parent 1277fa2 commit 23b0805

File tree

1 file changed

+7
-1
lines changed
  • packages/components-native/src/Switch/components/BaseSwitch

1 file changed

+7
-1
lines changed

packages/components-native/src/Switch/components/BaseSwitch/BaseSwitch.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export function BaseSwitch({
8585
};
8686
}
8787
}
88+
// Temporary fix for iOS 26. Remove when we upgrade to RN 0.81.
89+
// https://github.com/facebook/react-native/pull/53389
90+
const iOSBackgroundColor =
91+
Platform.OS === "ios" && Platform.Version?.startsWith("26.")
92+
? undefined
93+
: tokens["color-interactive--background"];
8894

8995
return (
9096
<Switch
@@ -98,7 +104,7 @@ export function BaseSwitch({
98104
disabled={disabled}
99105
thumbColor={getThumbColor()}
100106
trackColor={getTrackColors()}
101-
ios_backgroundColor={tokens["color-interactive--background"]}
107+
ios_backgroundColor={iOSBackgroundColor}
102108
accessibilityLabel={accessibilityLabel}
103109
accessibilityRole={"switch"}
104110
accessibilityState={{

0 commit comments

Comments
 (0)