Do not close dialog when clicking on the backdrop when it contains a form #3334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
The docs state that dialogs should not be closed when clicking on the backdrop, when the dialog contains a form:
This behavior was not implemented yet. The PR adds the check to the mouse click handler for the dialog that it is not automatically closed, when the dialog contains a form.
Screenshots
Monosnap.screencast.2025-02-18.09-43-15.mp4
Integration
As this fix implenents behavior that is already documented, IMHO no change to documentation is needed.
List the issues that this change affects.
Fixes #3214
Risk Assessment
What approach did you choose and why?
As the docs state that regardless of the state of the form the dialog should not be closed, I did not implement any logic to do dirty tracking of the form or similar, instead I just check for existance of a form within the dialog and thus prevent the auto closing logic.
Anything you want to highlight for special attention from reviewers?
no
Merge checklist