Skip to content

feat: add conditional closing to/in FluentDrawer/FluentDialog #4830

@sebitsi

Description

@sebitsi

🙋 Feature Request

Create CanClose event to prevent closing drawer/dialog.

🤔 Expected Behavior

When user/program want to close drawer/dialog there should be central event - f.e. CanClose. If we decide that closing is not allowed, drawer/dialog can't be closed. This even should fire on all closing actions (ESC, click outside - overlay, click on top header closing action or calling dialogInstance methods (CancelAsync, CloseAsync, etc).

😯 Current Behavior

When user press ESC or click outside drawer or top right "X" button, drawer is closed without possibility to stop closing.

💁 Possible Solution

Create event CanClose(bool canClose, string result). This event sould be fired on all closing actions.
By default canClose is true. If we set this value to false closing execution is stopped and drawer/dialog remains open.

🔦 Context

Drawer/dialog could be containers of forms. Exiting without control causes data loss in editforms.
We need such event to test if data were changed. And if data were changed in need a way to prevent closing
if user decide so.

Like github in this dialog.

For our future application, this is a feature that ranks very high in priority, as data entry is a very important feature.

💻 Examples

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed:doneWork is finishedimprovementA non-feature-adding improvementv5For the next major version

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions