-
Notifications
You must be signed in to change notification settings - Fork 502
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
Sidebar menu opened by tab + enter does not receive focus #7123
base: dev-mail
Are you sure you want to change the base?
Sidebar menu opened by tab + enter does not receive focus #7123
Conversation
8e159c9
to
36040ee
Compare
- exporting hadleFocus() from GuiUtils Co-authored-by: rih <rih@tutao.de>
36040ee
to
c80504f
Compare
@@ -363,6 +365,9 @@ export class ViewSlider implements Component<ViewSliderAttrs> { | |||
}) | |||
.finally(() => { | |||
foregroundColumn.isInForeground = toForeground | |||
if (foregroundColumn.domColumn && !toForeground) { |
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.
the previous attempt by @jalhubb was similar and led to some issues, I think would be good if he could check it
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.
oh sorry I meant @rezbyte
show() { | ||
this.focusedBeforeShown = document.activeElement as HTMLElement | ||
this.turnTrapFocus(true) | ||
handleFocus(true, [".main-view"]) |
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.
It might be nicer to curry this rather than pass in [".main-view"]
each time.
onupdate(vnode: m.VnodeDOM<Attrs>): any { | ||
if (vnode.dom.parentElement) { | ||
const trapFocus = vnode.dom.parentElement.style.visibility === "visible" | ||
handleFocus(trapFocus, ["nav", ".view-columns"]) | ||
} | ||
}, |
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.
This couples the FolderColumnView
to the ViewSlider
which will be not so nice when we refactor the ViewSlider
. I would also advise against giving components access to their parents if possible.
Have you tried creating an isFocused
attribute then passing in (vnode.dom as HTMLElement).style.visibility === "visible"
from the ViewSlider
into it?
Opening the sidebar then resizing the window to three column layout, then back to single column view causes the sidebar to become unopenable. |
Co-authored-by: rih rih@tutao.de
Closes #7118