-
Notifications
You must be signed in to change notification settings - Fork 1
Core-20: clear selection when user tab-navigates #2578
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
base: main
Are you sure you want to change the base?
Core-20: clear selection when user tab-navigates #2578
Conversation
c960db6
to
eb2267e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really what is needed to implement what is in the card? The card is just confusing to me and talks about a bunch of different things.
if (!selection?.rangeCount) { | ||
return; | ||
} | ||
const userRange = selection?.getRangeAt(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selection
should always be defined by this point (after the early return check). Is TS complaining?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's TS complaining. I'm sorry, this shouldn't be up for review yet. I was just trying to get a deployment.
} | ||
|
||
document.addEventListener('focusin', handleFocusChange); | ||
document.addEventListener('focusout', handleFocusChange); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So any focus change at all clears the selected text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. That's the issue as I understand it: Otto would select some text, and then tab elsewhere and it would still be ready to create the highlight.
7c665b9
to
95a8381
Compare
Update EditCard.spec.tsx.snap
95a8381
to
9ec69a8
Compare
9ec69a8
to
1b5aca0
Compare
CORE-20