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

Plan: Handling Text Selection/Deletion #46

Closed
trueadm opened this issue Feb 2, 2021 · 0 comments · Fixed by #202
Closed

Plan: Handling Text Selection/Deletion #46

trueadm opened this issue Feb 2, 2021 · 0 comments · Fixed by #202

Comments

@trueadm
Copy link
Collaborator

trueadm commented Feb 2, 2021

This is an umbrella issue to cover all the various use-cases for keyboard text selection and text deletion.

Note: we may change parts of this plan.

Keyboard Text Selection

Moving backward/forward

  • We should listen to left and right arrow events (without the relevant modifier for the OS)
  • We may have to apply some polyfills around moving selection between blocks
  • We may need to apply some custom logic around segmented/immutable nodes for accessibility purposes
  • Otherwise, should use the default native browser behavior

Deleting backward/forward

  • If beforeinput is supported we should attempt to use the boundary from getTargetRanges()
  • If beforeinput is not supported, we should apply a naive (and cheap) boundary implementation
  • We may need to apply some custom logic around the deletion of adjacent segmented/immutable nodes

Moving/Deleting a word backward/forward

  • If Intl.Segmenter is supported, we should always use this to work out the right word boundary
  • If Intl.Segmenter is not supported, we should check if native beforeinput is supported.
  • If beforeinput is supported we should attempt to use the boundary from getTargetRanges()
  • If beforeinput is not supported, we should apply a naive (and cheap) word boundary implementation

Moving/Deleting a line backward/forward

  • If beforeinput is supported we should attempt to use the line boundary from getTargetRanges()
  • If beforeinput is not supported, we should apply a naive approach and move the selection to the start of the current block.

Moving a block backward/forward

  • Should use the default native browser behavior
@trueadm trueadm changed the title Plan for Text Selection/Deletion Plan: Handling Text Selection/Deletion Mar 2, 2021
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

Successfully merging a pull request may close this issue.

2 participants