Repository navigation
Pattern Creator: Give the title wrapper a width so it can be clicked - #795
Conversation
The title wrapper sits in a column flexbox with auto side margins and no width, so it shrinks to the title's text width: 0px on a new pattern. Once focus leaves the title there is nothing to click back into. Fixes #793 Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Fixes #793
Root cause
.pattern-visual-editor__post-title-wrapperhasmax-width: 960pxand auto side margins but no width, and its parent.pattern-visual-editoris a column flexbox. In a column flex container, auto cross-axis margins overridestretch, so the wrapper shrinks to its content width. The contenteditable title is empty on a new pattern, so the wrapper is 0px wide and can't be clicked. Once a title has text, the wrapper is only as wide as that text, so clicking anywhere else in the title band misses. Typing initially works only because Gutenberg autofocuses the title on a clean new post, which is why it looks like "once you click out, you can't click back in".Both rules date from 2021. Gutenberg removing the rich-text element's inline
min-width: 1px(WordPress/gutenberg#75370) took the wrapper from 1px to 0px, but the layout was the underlying problem.Fix
Give the wrapper
width: 100%so the existingmax-widthand auto margins center a full-width title.Testing
/new-pattern/and dismiss the welcome guide.Verified against Gutenberg 24.2.0. Before the fix the wrapper measured 0px wide; after, 960px.
🤖 Generated with Claude Code
Summary by CodeRabbit