jeanregisser / react-native-slider

A pure JavaScript <Slider> component for react-native
MIT License
1.3k stars 571 forks source link

Thumb not visible after exposing via LayoutAnimation API on Android #143

Open JeremyBradshaw7 opened 6 years ago

JeremyBradshaw7 commented 6 years ago

Strange one this - I've found that the thumb is not visible after exposing any sliders (in a View) via the LayoutAnimation API - on Android only. Not sure about the Animated API. Workaround is to avoid animating on Android, but that's not ideal, so could do with a fix.

dancherb commented 6 years ago

I'm also having this problem - couldn't think what it was to do with (starting on the screen with the slider worked, but navigating to it didn't) so thanks for pointing that out

hackerart commented 4 years ago

Any updates on this?

DovletAmanov commented 4 years ago

In my case I removed "valueVisibleStyle" from style object of View of customThumb and it worked. Briefly I changed this part:

 <Animated.View
                    onLayout={this._measureThumb}
                    renderToHardwareTextureAndroid={true}
                    style={[
                        {
                            backgroundColor: thumbTintColor
                        }, customThumb ? {
                            position: 'absolute',
                            backgroundColor: 'transparent',
                        } : mainStyles.thumb, thumbStyle,
                        {
                            transform: [
                                { translateX: thumbLeft },
                                { translateY: 0 }
                            ],
                            // remove this line ->  ...valueVisibleStyle
                        }
                    ]}
                >
                   {customThumb}
            </Animated.View>