react-native-ui-lib
react-native-ui-lib copied to clipboard
SegmentedControl UI Issues
Description
SegmentedControl does not work as expected - strange dot in the center and selected segment is not highlighted properly.
Related to
- [x] Demo
Steps to reproduce
Steps to reproduce the behavior:
- Go to 'https://snack.expo.dev/@ethanshar/rnuilib_snack?platform=web'
- Scroll down to 'SegmentedControl'
- Click on 'SegmentedControl'
- UI issue is there
Expected behavior
Selected segment should be highlighted with the background. Dot in the center should not be present
Actual behavior
Strange dot in the center and selected segment is not highlighted properly.
More Info
Code snippet
import _ from 'lodash';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import 'react-native-reanimated';
import {screens} from 'unicorn-demo-app';
import MainScreen from './MainScreen'
const Stack = createStackNavigator();
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Main">
<Stack.Screen name="Main" component={MainScreen}/>
{_.map(screens, (screen, key) => {
return <Stack.Screen key={key} name={key.replace('Screen', '')} component={screen}/>;
})}
</Stack.Navigator>
</NavigationContainer>
);
}
Screenshots/Video
Environment
- React Native version: 0.73.6
- React Native UI Lib version: 7.20.0
Affected platforms
- [x] Android
- [x] iOS
- [x] Web
same since upgrading to React-Native 0.73.x. 0.72.x was working fine.
Same here. Some additional hints for reproducing the bug: When selecting Expo v50 or higher in the Snack demo on web, the SegmentedControl works correctly, somehow. But on iOS/Android the bug still exists.
(my environment: Expo v51.0.8, RNUILib v7.22.0, RN v0.74.1)
if you set outlineWidth to 0, the dot disappears.
Hi @Chehow , we are currently working with react-native 0.71
.
Does it reproducing on a real device/simulator ?
If you are using our demo app on simulator device it's working as expected.
Just checked the latest version of the library and it works fine.