-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[core] fix(Overlay): capture focus when it returns to document #4907
Conversation
const decoratedChild = | ||
typeof child === "object" ? ( | ||
React.cloneElement(child as React.ReactElement, { | ||
className: classNames((child as React.ReactElement).props.className, Classes.OVERLAY_CONTENT), | ||
tabIndex: this.props.enforceFocus || this.props.autoFocus ? 0 : undefined, |
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.
removing this fixes an issue w/ the omnibar where the container and the input are both focusable, even though you probably don't want the container to be focusable in that situation. now that we have focus traps, this doesn't seem necessary. if consumers want non-focusable elements to be focusable, they will need to take care to set tabindex themselves. not sure if this constitutes a break
b770f77
to
2bc9d82
Compare
Capture focus when it returns to the documentPreviews: documentation | landing | table |
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.
…ocus-from-browser
I think this is a result of the infinite focus bug due to |
Comment grammarPreviews: documentation | landing | table |
Follow up to #4894 (comment)
Screenshot
Before -- focus would not return to overlay if coming back to the document from somewhere outside (e.g. url, native browser controls)
After -- focus immediately returns to overlay