-
Notifications
You must be signed in to change notification settings - Fork 171
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
Only set width/height on zero-size element conversion #4351
Only set width/height on zero-size element conversion #4351
Conversation
Job #8623: Bundle Size — 63.27MiB (~-0.01%).
Warning Bundle contains 64 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
View job #8623 report View fix/zero-sized-element-remove-ab... branch activity |
function maybeAddDisplayInlineBlockCommands( | ||
element: ElementInstanceMetadata, | ||
): Array<CanvasCommand> { | ||
if (isIntrinsicallyInlineElement(element)) { |
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.
maybe flip the logic here for an early return or a ternary return
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.
This looks good, but please hold off on merging until #4360 is complete, as that includes a refactoring of a function sizeToDimensionsFromFrame
that it would make sense to use here.
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.
the new code reads so much better!
…to fix/zero-sized-element-remove-absolute-props
Problem
When double-clicking the zero-sized element control on an element that is in a flex parent and has position: absolute set, the flexBasis prop is not taken into account, and the element stays zero-sized on one axis.
FIx
The logic doing the conversion is refactored into two inspector strategies:
flex
,flexShrink
,flexGrow
andflexBasis
are pruned so they don't interfere with sizingdisplay: inline-block
is added