-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Patterns: add a component to display empty pattern title #52548
Conversation
Click/Hitting enter on the empty pattern doesn't do anything (no pattern is inserted, even though a notice appears reporting the contrary) Should we therefore also disable mouse/keyboard events on empty patterns? And if we do what's the best approach to maintain decent accessibility? I'm mainly thinking of labelling somewhere that it's mainly a placeholder. |
Size Change: +193 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 6b2cb00. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5528057030
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6b2cb00
to
a9396be
Compare
@glendaviesnz do you think this PR is still valid? I'd forgotten about it 🤣 BeforeAftercc @SaxonF for a view on the empty placeholder 🙇🏻 |
viewportWidth={ viewportWidth } | ||
/> | ||
{ ! isEmpty ? ( | ||
<BlockPreview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also disable the onClick
on the .block-editor-block-patterns-list__item
element?
If you click on a pattern with no content, a message appears — "[Your pattern] inserted" — but it inserts nothing.
Just catching up on this, so apologies if there's context I'm missing! Since the pattern is empty and adding it would be a no-op, what if we hide empty patterns from the inserter altogether instead of using a placeholder? Or is it preferable that they're still visible there? |
Thanks @andrewserong That's a good question, and perhaps one I skated over because of the title of the issue, which implies that they should be there?
cc @glendaviesnz for guidance |
Yeh, it sort of makes sense to have them show in the site editor because you want to edit them and add some content. Although it might be confusing for a user to see them in site editor and not the post editor, I wonder if in fact it would be more confusing that they appear but when inserted don't add anything to the post? I guess there could be grounds for calling this a feature rather than a bug 🤔 |
Thanks for chiming in. I've labelled it optimistically as an enhancement. 😄 |
What?
Resolves #52227
Adds a component that will display an empty pattern in the inserter.
The pattern's title is used in order to display something and to discern between other patterns.
Why?
If an unsynced pattern is added via the site editor library, but has no content, it does not appear in the post editor inserter.
Testing Instructions
2023-07-12.15.36.27.mp4