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

trailing space in section is eaten by browser when deleting #68

Closed
bantic opened this issue Aug 12, 2015 · 1 comment
Closed

trailing space in section is eaten by browser when deleting #68

bantic opened this issue Aug 12, 2015 · 1 comment
Assignees

Comments

@bantic
Copy link
Collaborator

bantic commented Aug 12, 2015

In Chrome and Safari, when the cursor is at a character with a space behind it, after hitting delete once the cursor skips backward across the space:

  • text is "abc d", cursor is after the d.
  • Hit delete and the cursor is now after the "c" instead of after the space. The DOM still has the space but you can't use the arrow keys to move the cursor past it.

Firefox leaves the cursor after the space, as expected.

@bantic
Copy link
Collaborator Author

bantic commented Aug 12, 2015

This appears to be due to Chrome/Safari not properly setting the cursor position when the text node has a trailing space. Firefox displays the cursor at the correct spot but doesn't enter text in the right place when hitting a key.

Example codepen

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

1 participant