-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Snackbar: Display Snackbar
on top of Modal Screen Overlay
#68728
Comments
Displaying the
If the |
In normal flow, you just dismiss "Snackbar" and continue doing what you did. But with the modal, you'll have to re-open it, which could be inconvenient. I don't have an answer to what's the best UX here; this is why I requested additional feedback before we try to solve anything. |
Given this, maybe the snackbar isn't the right choice. Instead, should we show the notification inside a modal, like the font library modal? Or, if the modal was to be closed when the pattern was inserted, the current snackbar would make sense. When the pattern modal was first implemented, it seemed to close the modal when the pattern was inserted (see the video attached to #35773). It might be a good idea to first look into when and why this behavior was changed. |
I'd agree this should be investigated to understand what the reasoning behind the change was. Edit: In WordPress 6.6 the Patterns explorer modal dialog closes when inserting a pattern so the change in behavior must be pretty recent. |
Raising this issue to In fact, when using the keyboard and inserting a pattern from the modal dialog, the dialog stays open and focus moves to the inserted pattern in the editor canvas. As such, focus is outside the modal dialog, which is something that should never happen. I do realize that when using the mouse this regression isn't immediately clear but this only proves that whatever the change that introduced this bug is, it hasn't been tested sufficiently with keyboard. This is far from ideal as largely untested changes keep being introduced in the UI often breaking basic interaction flows. To reproduce.
Screenshot:
Wondering whether we should close this issue and create a new one to report the root cause of the bug: the modal dialog should close. |
I would like to investigate this point first. |
I identified this behavior as being changed in #63059. The discussion in #61051 was about whether to keep the sidebar inserter open or not. It seems that they ultimately agreed on a policy of not closing the sidebar inserter when clicking on the canvas. However, there was no mention of the Pattern Explorer modal, so the current behavior may not be what was intended. Perhaps we need to decide which is the ideal behavior for the pattern explorer modal. When we click on a pattern in the pattern explorer modal:
|
Description
The
z-index
of thesnackbar
component currently matches that of themodal screen overlay
:gutenberg/packages/base-styles/_z-index.scss
Lines 113 to 117 in 064b879
As a result, the
snackbar
is rendered behind themodal overlay
. Sincesnackbars
provide critical feedback for user actions, they should ideally appear above themodal overlay
to ensure their visibility.For example, when inserting a
Pattern
through theExplore all patterns
modal, selecting a pattern successfully adds it to the post content and triggers asnackbar
notification. However, because thesnackbar
is hidden behind themodal overlay
, users cannot see the feedback. This behavior does not provide proper feedback to the user and forces them to close the modal to confirm the action manually.This behavior is demonstrated more clearly in the attached video.
Step-by-step reproduction instructions
post edit
screen.Block Inserter
.Patterns
tab and open theExplore all patterns
dialog.Pattern
from theDialog
.snackbar
got generated behind theDialog
.Screenshots, screen recording, code snippet
issue.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: