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

Keyboard getting opened On slider touch #67

Open
YashM20 opened this issue Mar 9, 2024 · 2 comments
Open

Keyboard getting opened On slider touch #67

YashM20 opened this issue Mar 9, 2024 · 2 comments

Comments

@YashM20
Copy link

YashM20 commented Mar 9, 2024

import { StyleSheet, Text, View, TextInput } from 'react-native'
import React from 'react'
import { useSharedValue } from 'react-native-reanimated';
import { Slider } from 'react-native-awesome-slider';

const AnimatedSlider = () => {
  const progress = useSharedValue(30);
  const min = useSharedValue(0);
  const max = useSharedValue(100);
  return (
    <>
      <Slider
        style={styles.container}
        progress={progress}
        minimumValue={min}
        maximumValue={max}
        cache={true}
        heartbeat={true}
        hapticMode='step'
      />
    </>
  );
}

export default AnimatedSlider

const styles = StyleSheet.create({
  container: {
    flex: 1,
    minWidth: 300,
    backgroundColor: "skyblue"
  }
})

On opening the screen containing this slider, it automatically opens a keyboard, there is not text inputs present in entire screen.
I tried to look into the package code I guess TextInput from packages's BubbleComponent is getting focused.
Here's a code from your module.

<Animated.View
          style={{
            ...BUBBLE_STYLE,
            backgroundColor: color,
            maxWidth: bubbleMaxWidth,
          }}
        >
          <TextInput
            ref={textRef}
            textAlign="center"
            style={[styles.textStyle, { color: textColor }, textStyle]}
            defaultValue=""
            caretHidden
          />
        </Animated.View>
@alantoa
Copy link
Owner

alantoa commented May 8, 2024

Hey, have you checked if it's related to enabling autoFocus on TextInput somewhere?
Did you enable any default keyboard behavior somewhere? I assume that's it because this library does not rely on any keyboard events.

@Ibad9
Copy link

Ibad9 commented Jun 6, 2024

You can try to patch the package and just add editable={false} prop. It should work perfect then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants