Easy to close by mistake - esc key

Created on 17 July 2024, 4 months ago
Updated 18 July 2024, 4 months ago

Problem/Motivation

I was creating a new content item in an admin dialog, trying some new things in ckeditor, and accidentally closed the dialog window and lost my changes.

The escape key is used in ckeditor shortcuts, so this is something that could happen quite easily if you press it in the wrong context or accidentally double tap.

This is not just related to ckeditor, we might mash esc to close an autocomplete or popup from a password manager.

Steps to reproduce

Fill out a dialog form, then press escape before submitting. Your changes are gone :(

Proposed resolution

Add an option to confirm closing the modal. So the keystrokes to close would be esc, enter.
If there are no changes, esc skips the confirmation and just closes.

Remaining tasks

Determine if this is a good idea, and details on implementation.

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: works as designed

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mortona2k
  • Status changed to Closed: works as designed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States minnur San Francisco

    Unfortunately we don't have much control over dialog's behavior because the module is using dialogs provided by Drupal core.

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    It's possible to use the jquery dialog api to add some features. I was thinking a confirmation box could be implemented with the beforeClose event. But understandable if it's too niche for this module.

Production build 0.71.5 2024