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

expose props API to enable selection range get & set #256

Open
ibarapascal opened this issue Mar 1, 2022 · 1 comment
Open

expose props API to enable selection range get & set #256

ibarapascal opened this issue Mar 1, 2022 · 1 comment

Comments

@ibarapascal
Copy link

ibarapascal commented Mar 1, 2022

as title

current

currently, I guess it's not supported to customize the selectionRange to the contentEditable element.

ref.current.setSelectionRange(4, 6);

there are some cases like inserting some text to replace the current cursor's selected content as well as keeping the after cursor position at the addition end programmatically (controlled, bound with onChange handler).

enhancement

since we do have the method to manually get & set the range via the API, it would be much more convenient to do so with an exposed props API with the related function included.

related QA: https://stackoverflow.com/questions/6249095/how-to-set-the-caret-cursor-position-in-a-contenteditable-element-div

@mahmedmushtaq
Copy link

@team please add this feature

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

2 participants