QDialog: allow changing no-refocus
after dialog is shown
#17513
Unanswered
ddenev
asked this question in
Ideas / Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, we can provide a
no-refocus
prop to QDialog is we want to instruct the dialog to not refocus on hiding.The current implementation though does not account for the case when we change the
no-refocus
prop after the dialog is shown. Setting it in this way has no effect and the dialog re-focuses anyway.This behaviour is because in QDialog.js
no-refocus
is only read once in thehandleShow()
function.Please add a condition to
handleHide
to check for the value ofno-refocus
once again in order to cover the case above.My use case:
I have a dialog (A) with several buttons in it. Clicking on one of the buttons opens another dialog (B). In B there is an input field with
autofocus
set totrue
. Opening B also immediately closes A (viaA.onDialogCancel()
). I want to setno-refocus
on A but only when I click on the button for B. Any other buttons that open dialogs - I do not want to setno-refocus
for A. This is the reason why I need to be able to setno-refocus
later. Also, I do not want to setno-refocus
statically for A - that would mean it will always not refocus and I need this to happen only when I want it.Beta Was this translation helpful? Give feedback.
All reactions