wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.47k stars 707 forks source link

SegmentedControl UI Issues #3032

Closed Chehow closed 4 weeks ago

Chehow commented 5 months ago

Description

SegmentedControl does not work as expected - strange dot in the center and selected segment is not highlighted properly.

Related to

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to 'https://snack.expo.dev/@ethanshar/rnuilib_snack?platform=web'
  2. Scroll down to 'SegmentedControl'
  3. Click on 'SegmentedControl'
  4. 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

image

Environment

Affected platforms

Relax594 commented 5 months ago

same since upgrading to React-Native 0.73.x. 0.72.x was working fine.

MichaelHerrmann1 commented 4 months ago

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)

burnaDLX commented 4 months ago

if you set outlineWidth to 0, the dot disappears.

adids1221 commented 1 month ago

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.

Chehow commented 4 weeks ago

Just checked the latest version of the library and it works fine.