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

fix: Block max content width #2694

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/block-components/helpers/size/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ const Styles = props => {
responsive="all"
hasUnits="px"
/>
<BlockCss
{ ...propsToPass }
selector={ wrapperSelector || selector }
styleRule="width"
attrName="width"
key="width"
attrNameTemplate={ attrNameTemplate }
responsive="all"
hasUnits="px"
bfintal marked this conversation as resolved.
Show resolved Hide resolved
valueCallback={ ( value, getAttribute ) => {
const blockWidth = getAttribute( 'width' )
return blockWidth ? 'inherit' : ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use undefined here, I think there's a chance that the style might show up if it's an empty string.

Suggested change
return blockWidth ? 'inherit' : ''
return blockWidth ? 'inherit' : undefined

} }
/>
<BlockCss
{ ...propsToPass }
selector={ wrapperSelector || selector }
Expand Down