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

Fix lost focus on page load due to false equivalency check #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmlambo
Copy link

@dmlambo dmlambo commented Jan 9, 2020

Focus was being cleared via selection.empty() since clearHighlight didn't early-exit on first run, due to selText being undefined rather than null. Coerce selText to Boolean to catch this case.

Focus is still lost when character highlighting is done, which seems like unintended behaviour. To make that better I'd suggest storing the carat position and using Selection.collapse(ToEnd|ToStart).

…dn't early-exit on first run, due to selText being undefined, rather than null. Coerce selText to boolean to catch this case.
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 this pull request may close these issues.

2 participants