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

Editable text field doesn't listen to Shift + Home/End #377

Closed
joriswave opened this issue Feb 6, 2024 · 6 comments
Closed

Editable text field doesn't listen to Shift + Home/End #377

joriswave opened this issue Feb 6, 2024 · 6 comments

Comments

@joriswave
Copy link

As an alternative to Ctrl+A, it should be possible to select all text in a text field by doing Home/End, Shift+End/Home. Currently, the Shift doesn't trigger selection to happen.

Additionally/optionally, Ctrl+Left/Right Arrow should jump by "words" (and Shift+Ctrl+Left/Right select by "words" ).

djowel added a commit that referenced this issue Feb 7, 2024
@djowel
Copy link
Member

djowel commented Feb 7, 2024

Fixed

@djowel djowel closed this as completed Feb 7, 2024
@djowel
Copy link
Member

djowel commented Feb 7, 2024

Additionally/optionally, Ctrl+Left/Right Arrow should jump by "words" (and Shift+Ctrl+Left/Right select by "words" ).

BTW, probably mac centric, IDK, but moving by words is option/alt+Left/Right and selecting words is shift+option/alt+Left/Right

@djowel
Copy link
Member

djowel commented Feb 7, 2024

Additionally/optionally, Ctrl+Left/Right Arrow should jump by "words" (and Shift+Ctrl+Left/Right select by "words" ).

BTW, probably mac centric, IDK, but moving by words is option/alt+Left/Right and selecting words is shift+option/alt+Left/Right

OK, I implemented using the option key for moving cursor across words in the Mac and control key in Windows and Linux. Please test on Windows. It seems the Mac is the only one using the option key for moving cursor across words.

@djowel
Copy link
Member

djowel commented Feb 8, 2024

@joriswave BTW, another way to select all is by triple click.

@joriswave
Copy link
Author

OK, I implemented using the option key for moving cursor across words in the Mac and control key in Windows and Linux. Please test on Windows. It seems the Mac is the only one using the option key for moving cursor across words.

Works - thank you! 🙏 The only thing now is that usually a "word" doesn't only end with a space character, but also a non-letter character (don't know the exact rule here, or if there even is a standard), such that you can, e.g., skip over the sub folders within a file path or url with Ctrl+Left/Right.

@joriswave BTW, another way to select all is by triple click.

👍

@djowel
Copy link
Member

djowel commented Feb 8, 2024

The only thing now is that usually a "word" doesn't only end with a space character, but also a non-letter character (don't know the exact rule here, or if there even is a standard), such that you can, e.g., skip over the sub folders within a file path or url with Ctrl+Left/Right.

There are precise rules for that dictated by the Unicode Line Breaking Algorithm. See the linebreak library that Elements uses: https://github.com/foliojs/linebreak which also deals with word breaks. No, the slash is not a word break.

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