Skip to content
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

Implement a custom event for modal dismiss #264

Closed
Tracked by #308
zonia3000 opened this issue Aug 25, 2023 · 3 comments · Fixed by #306
Closed
Tracked by #308

Implement a custom event for modal dismiss #264

zonia3000 opened this issue Aug 25, 2023 · 3 comments · Fixed by #306

Comments

@zonia3000
Copy link
Collaborator

Sometimes it is necessary to execute custom logic on modal close (see #262). Currently we have associated this custom logic to the close button, but a modal can be closed also clicking on the X button on the top right corner or clicking outside the modal, so at the moment a static backdrop has been set to force the user to close the modal only by clicking on the button. Since this can be annoying it should be better to define a custom Svelte event to execute this custom logic for each closing method.

@tcompa
Copy link
Collaborator

tcompa commented Aug 25, 2023

Note that another way of closing the modal is via the esc key (which is not prevented by the static backdrop).

@jluethi
Copy link
Collaborator

jluethi commented Aug 25, 2023

Interesting! But the esc key is not working to close all things I'd be expecting. For example, I often press esc to close a log window on the job page and that isn't working. Not sure whether the log display is a different model, but would be great to have that match the same closing functionality (and for example also work with esc)

@tcompa
Copy link
Collaborator

tcompa commented Aug 25, 2023

But the esc key is not working to close all things I'd be expecting.

Yes, I confirm.

This current issue concerns the specific case of the task-edit modal, where we are looking for the best way to perform an action upon closing the modal (typically a reset of some changes that were eventually discarded by closing the modal). Once we manage to fully clean up this specific example, we'll replicate all around the repo - aiming for as much homogeneity as possible.

@zonia3000 zonia3000 mentioned this issue Oct 5, 2023
1 task
@tcompa tcompa mentioned this issue Oct 6, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants