You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
as title
current
currently, I guess it's not supported to customize the
selectionRange
to thecontentEditable
element.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
The text was updated successfully, but these errors were encountered: