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

Word delete only deletes until first accent/special char #628

Closed
kevinansfield opened this issue Jun 19, 2018 · 1 comment · Fixed by #632
Closed

Word delete only deletes until first accent/special char #628

kevinansfield opened this issue Jun 19, 2018 · 1 comment · Fixed by #632

Comments

@kevinansfield
Copy link
Collaborator

Word deletion (Alt+Backspace/Delete) will only delete until the first character with an accent. This differs from default OS behaviour, at least on macOS (Windows needs testing).

Mobiledoc-kit:
mobiledoc-word-delete

Normal textarea (macOS):
textarea-word-delete

@kevinansfield
Copy link
Collaborator Author

kevinansfield commented Jul 10, 2018

The issue is arising because of the basic /\w|_|:/ word char regex in the position class that is used in the word unit movements. JavaScript's unicode support is pretty much non-existent for RegExp without resorting to an external library like XRegExp and vastly expanding the ranges of characters to cover all the possible languages that may be used.

However, if the custom delete key handler is removed then the default OS behaviour returns which is much preferred.

@mixonic do you know if the custom handler is there purely so that it can be wrapped in will/did-delete hook callbacks or does it also cover up some browser inconsistencies?

kevinansfield added a commit to kevinansfield/mobiledoc-kit that referenced this issue Jul 11, 2018
closes bustle#628
- expanded `WORD_CHAR_REGEX` to include full unicode list of word chars by generating the regex through XRegExp (http://xregexp.com)
kevinansfield added a commit to kevinansfield/mobiledoc-kit that referenced this issue Jul 11, 2018
closes bustle#628
- expanded `WORD_CHAR_REGEX` to include full unicode list of word chars by generating the regex through XRegExp (http://xregexp.com)
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.

1 participant