Skip to content

Focus trap for QDialog #16756

Jan 9, 2024 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

Hi,

The focus is already trapped inside of the Dialog, but we cannot override the browser behavior of being able to focus on the address bar too. Moreover, if the Developer Tools is also opened, we also cannot avoid focusing on it too.

The current default behavior IS to trap the focus within the Dialog's elements given the above exceptions (addressbar or Dev tools).
There are also the following props, should you want to configure how the focus works (disabling more of the default features):

  • allow-focus-outside --> disables the default focus trap
  • no-focus --> when Dialog gets shown, do not switch focus on it
  • no-refocus --> when Dialog gets hidden, do not refocus on the DOM element that pr…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Anubarak
Comment options

Answer selected by rstoenescu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants