react-native-toggle-element icon indicating copy to clipboard operation
react-native-toggle-element copied to clipboard

Thumb hides behind track on upgrade to ReactNative 76

Open mahcloud-tinker opened this issue 1 year ago • 6 comments

Here are our custom styles

return (
    <Toggle
      onPress={onToggle}
      thumbButton={{
        width: 20,
        height: 20,
      }}
      thumbStyle={{
        activeBackgroundColor: '#303030',
      }}
      trackBar={{
        activeBackgroundColor: '#E5FE52',
        inActiveBackgroundColor: '#C7C7C7',
        borderActiveColor: '#E5FE52',
        borderInActiveColor: '#C7C7C7',
        borderWidth: 3,
        radius: 20,
        height: 20,
        width: 40,
      }}
      value={isOn}
    />
  );

This worked for us in RN 0.73.9 but after we upgraded to RN 0.76.5, the thumb button would always hide behind the track bar. Even if I change the styling to make the thumb button bigger, it would still be hidden behind the trackbar.

mahcloud-tinker avatar Jan 23 '25 17:01 mahcloud-tinker

Also experiencing the same issue - hope the PR above can be merged!

aabolade avatar Feb 14 '25 05:02 aabolade

Try to add trackBarStyle={{zIndex: -1}}

Worked for me on iOS

sirmong avatar Mar 26 '25 17:03 sirmong

Try to add trackBarStyle={{zIndex: -1}}

Worked for me on iOS

Works on Android too. Thanks!

n-ii-ma avatar Apr 06 '25 08:04 n-ii-ma

Still getting this issue, fix works though!

chico-oliveira avatar Apr 16 '25 01:04 chico-oliveira

Same issue, fix works though

matheuscouto avatar Aug 20 '25 15:08 matheuscouto

Try to add trackBarStyle={{zIndex: -1}}

Worked for me on iOS

you saved my life

Huy22032002 avatar Aug 27 '25 07:08 Huy22032002