react-native-actions-sheet icon indicating copy to clipboard operation
react-native-actions-sheet copied to clipboard

Text selection of TextInput inside ActionsSheet not working on Android

Open noumantahir opened this issue 3 years ago • 2 comments

I am using TextInput inside react-native-actions-sheet, apparently when I try to select text the selectors do not work. it does not also show selection menu for copy, paste, cut etc. The text input works fine when it is rendered outside of actions sheet

Tried API level 30 and 31

Sample Code

import React from 'react';
import {
  View,
  TextInput,
  Button,
} from 'react-native';
import ActionSheet from 'react-native-actions-sheet';

const SampleComponent = () => {

   const sheetModalRef = useRef<ActionSheet>();
  
   return (
      <View style={{ height: getWindowDimensions().height, backgroundColor: 'white' }}>

        <TextInput
          style={{ height: 200 }}
          placeholder={'Add text here first...'}
        />

        <Button
          title='Show Modal'
          onPress={() => {
            sheetModalRef.current.show()
          }}
        />


        <ActionSheet
          ref={sheetModalRef}
          containerStyle={{ height: 400 }}>
          <TextInput
            style={{ height: 200 }}
            placeholder={'Add text here...'}
          />
        </ActionSheet>

      </View>
    );
}

Demo Video

https://user-images.githubusercontent.com/6298342/173057480-a74b6bfd-552b-479f-bc79-0443a4d15495.mov

My Stack react-native: 0.63 react-native-actions-sheet: 0.6.1

noumantahir avatar Jun 10 '22 11:06 noumantahir

I just tested in the example app and it is working normally. Maybe it has to do something with your react-native version since it's older. Can you try the example app on the same device?

ammarahm-ed avatar Jun 26 '22 08:06 ammarahm-ed

The same for me, but just for Text components

RN version: 0.66 action sheet version: 0.6.1

vladyslavNiemtsev avatar Jul 15 '22 12:07 vladyslavNiemtsev

Fixed in v0.8.0

ammarahm-ed avatar Aug 21 '22 07:08 ammarahm-ed