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

Click and hold to select text using a text component on iOS #22458

Closed
ArsenyYankovsky opened this issue Nov 29, 2018 · 5 comments
Closed

Click and hold to select text using a text component on iOS #22458

ArsenyYankovsky opened this issue Nov 29, 2018 · 5 comments
Labels
Bug Component: Text Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@ArsenyYankovsky
Copy link

ArsenyYankovsky commented Nov 29, 2018

Environment

 React Native Environment Info:
    System:
      OS: macOS 10.14.1
      CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 334.21 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.7.0 - ~/.nvm/versions/node/v10.7.0/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.3.0 - ~/.nvm/versions/node/v10.7.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      @types/react: ^16.4.1 => 16.7.7 
      @types/react-native: ^0.57.14 => 0.57.14 
      react: 16.5.1 => 16.5.1 
      react-native: ^0.57.7 => 0.57.7 

Description

I want click-and-hold-to-select-text using a Text component and then i searched it and i found selectable property.It good works but it copy the entire text field.I want to selecting a subset of the text field for copying.Actually this question is asked on stackoverflow .Here is question on stackoverflow:http://stackoverflow.com/a/37119619/4596143

Reproduction Steps and Sample Code

I try this code block:

<Text
                        selectable={true}
                        style={styles.messageBody}>
                        {"text description"}
</Text>

This full of text ("text description") can copy not partially .I want to it like screenshot

Actual behaviour:
image

Expected behavior:

image

Reproducible Demo

I don't have a reproducible demo but should be pretty easy to create one.

I'm creating this because #13938 was closed but it's still an issue for a lot of people. Would be really nice if bot reopened closed issues if there's an activity on them because there's a lot of them.

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@tacomanator
Copy link

Just to note, there are other menu actions like "Speak" and "Define" which appear after selecting text which hopefully can be supported (probably would come out-of-the-box if this issue is addressed).

@fakenickels
Copy link

You can use this https://github.com/Astrocoders/react-native-selectable-text/

import { SelectableText } from "react-native-selectable-text";

// Use normally, it is a drop-in replacement for react-native/Text
<SelectableText
  menuItems={["Foo", "Bar"]}
  onSelection={({ eventType, content, selectionStart, selectionEnd }) => {}}
  value="I crave star damage"
/>;

it is for extracting and changing the selection menu but we implemented a way for you to select a subset of it

@stale
Copy link

stale bot commented Aug 4, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 4, 2019
@stale
Copy link

stale bot commented Aug 11, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 11, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: Text Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants