react-native-drag-text-editor icon indicating copy to clipboard operation
react-native-drag-text-editor copied to clipboard

Use the text prop to set text in editor

Open reggie3 opened this issue 4 years ago • 4 comments

The documentation says that the text prop is used to set the contents of the editor, but the current code expects to find that information in a PlaceHolder prop. This PR fixes the code to match the documentation.

reggie3 avatar Nov 14 '20 18:11 reggie3

Hey @reggie3! thanks for your attention. It looks like just a Readme mistake. Text value of editor is setting in onText function with onChangeText prop of TextInput in DragTextEditor.js. Also in that part you mentioned PlaceHolder prop is setting the first value of text state with a condition.Tell me If I'm missing something you said ?

eneskarpuz avatar Nov 15 '20 03:11 eneskarpuz

It sounds like you're saying that if we want to provide text to the DragTextEditor component, then it needs to be provided via the PlaceHolder prop; Is that correct? If not, how should the text be provided?

reggie3 avatar Nov 15 '20 13:11 reggie3

Want to provide external text to the component other than text entered on the keyboard? If so. Yes, You can do that with the PlaceHolder prop. The prop name may vary but you should do this for all the PlaceHolder props.

eneskarpuz avatar Nov 15 '20 22:11 eneskarpuz

Okay, that makes sense. If that is the case, then I don't think this PR is necessary.

reggie3 avatar Nov 15 '20 22:11 reggie3