-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add alt-S to navigate between search regions #2189
Conversation
bea6381
to
21fa234
Compare
46e1eb7
to
55a52bf
Compare
|
||
scrollTo(target); |
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 scrollTo()
just gone now? I noticed it was gone from the tests too.
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.
Yes. focus
will scroll an element into view unless you specify that it shouldn't.
f0e562b
to
d73dd2e
Compare
].map((q) => document?.querySelector(q)); | ||
|
||
// Determine which region we are in (if any) | ||
const currentSectionIndex = targets.findIndex((el) => el?.contains(document?.activeElement!)); |
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.
I'd do something like document?.activeElement && el?.contains(document.activeElement)
because activeElement can be null and idk if contains likes nulls or undefineds.
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.
null
is ok for contains
. activeElement
can be undefined, but there's no good way to make it so. In general, it will be set to body
if you blur
it from anything else.
I changed document?activeElement!
to document?activeElement ?? null
but could not write a test to hit the undefined branch.
Add documentation for Alt+S
DISCO-90