Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Only: Slider inside a ScrollView #298

Closed
anshul-kai opened this issue Aug 7, 2021 · 1 comment
Closed

Android Only: Slider inside a ScrollView #298

anshul-kai opened this issue Aug 7, 2021 · 1 comment
Labels
bug report Something isn't working duplicate This issue or pull request already exists platform: Android Issue related to Android platform

Comments

@anshul-kai
Copy link

Environment

Description

Slider doesn't work when embedded inside a ScrollView. No issues on iOS but on Android only taps respond.

Reproducible Demo

import React from 'react';
import type {Node} from 'react';
import {
  SafeAreaView,
  ScrollView,
  View,
  Dimensions
} from 'react-native';
import Slider from '@react-native-community/slider';

const Volume = ({children, title}): Node => {
  return (
    <Slider
    style={{width: 200, height: 40}}
    minimumValue={0}
    maximumValue={1}
    minimumTrackTintColor="#FFFFFF"
    maximumTrackTintColor="#000000"
  />
  );
};

const App: () => Node = () => {
  const width = Dimensions.get('window').width;
  const slideStyle = { width, justifyContent: 'center', alignItems: 'center'}
  return (
    <SafeAreaView style={{ flex: 1 } }>
      <ScrollView horizontal pagingEnabled removeClippedSubviews={false}>
        <View style={{backgroundColor: 'red', ...slideStyle}}><Volume /></View>
        <View style={{backgroundColor: 'blue', width, ...slideStyle}}><Volume /></View>
        <View style={{backgroundColor: 'green', width, ...slideStyle}}><Volume /></View>
      </ScrollView>
    </SafeAreaView>
  );
};

export default App;
@anshul-kai anshul-kai added the bug report Something isn't working label Aug 7, 2021
@BartoszKlonowski BartoszKlonowski added the platform: Android Issue related to Android platform label Aug 13, 2021
@BartoszKlonowski BartoszKlonowski added the duplicate This issue or pull request already exists label Aug 20, 2021
@BartoszKlonowski
Copy link
Member

This is the same issue as reported in #296.
I will close this one as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working duplicate This issue or pull request already exists platform: Android Issue related to Android platform
Projects
None yet
Development

No branches or pull requests

2 participants