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

[4.5]: Craft.cp.notification that contains buttons prevents shortcuts from working #13574

Closed
i-just opened this issue Aug 18, 2023 · 4 comments
Closed
Assignees

Comments

@i-just
Copy link
Contributor

i-just commented Aug 18, 2023

What happened?

Description

In the Control Panel, when Craft.cp.notification that contains a button (or input) is triggered, it prevents form shortcuts from working.

Caused by: https://github.com/craftcms/cms/blob/develop/src/web/assets/cp/src/js/CP.js#L1536-L1541

Steps to reproduce

  1. On the 4.5-beta.2 branch, open the entry edit page and attempt to save it and trigger a validation error.
  2. “This {type} has been updated.” notice should show with a “Reload” button.
  3. Try to use Ctrl/Cmd+S to save and continue editing.

Expected behavior

Once the notice has been dismissed, the shortcut should trigger the usual action. In the case of Ctrl/Cmd+S, it should trigger save and continue editing.

Actual behavior

Once the notice has been dismissed, the shortcut triggers the browser’s native Save As dialogue.
Screenshot 2023-08-18 at 12 35 30

Craft CMS version

4.5-beta.2

PHP version

8

Operating system and version

Mac OS

Database type and version

MySQL

Image driver and version

n/a

Installed plugins and versions

n/a

@brandonkelly
Copy link
Member

brandonkelly commented Aug 18, 2023

The notification is supposed to add a new UI layer when present, which would temporarily block any shortcuts registered to the previous UI layer. Without your PR, don’t the shortcuts resume once the notification is closed?

@i-just
Copy link
Contributor Author

i-just commented Aug 21, 2023

No, shortcuts don’t resume once the notification is closed (and no matter how you close it). They only resume if you reload the page. A notification has to contain a button (or input) tag for this behaviour to occur.

Screen.Recording.2023-08-21.at.11.40.32.mov

@arifje
Copy link

arifje commented Aug 23, 2023

Same issue here; shortcuts aren't enabled after the notification is gone. Only on a page refresh.

@brandonkelly
Copy link
Member

@arifje Fixed in 4.5.1 – see #13591 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants