-
Notifications
You must be signed in to change notification settings - Fork 172
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
Setting hugging parent to fixed is optional when converting to absolute #4354
Conversation
Job #8591: Bundle Size — 63.28MiB (~+0.01%).
Warning Bundle contains 64 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
View job #8591 report View feature/two-convert-to-absolute-... branch activity |
.../canvas/canvas-strategies/strategies/convert-to-absolute-and-move-strategy.spec.browser2.tsx
Outdated
Show resolved
Hide resolved
.../canvas/canvas-strategies/strategies/convert-to-absolute-and-move-strategy.spec.browser2.tsx
Outdated
Show resolved
Hide resolved
if ( | ||
!retargetedTargets.every((element) => { | ||
const elementMetadata = MetadataUtils.findElementByElementPath( | ||
canvasState.startingMetadata, | ||
element, | ||
) | ||
return ( | ||
elementMetadata?.specialSizeMeasurements.position !== 'absolute' && | ||
honoursPropsPosition(canvasState, element) | ||
) | ||
}) | ||
) { | ||
return null | ||
} |
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.
IMO this should also be returning null
if this is the set-hugging-parent-to-fixed
variant and the parent is not hugging, otherwise we end up providing 2 alternatives to the user that have no difference, which means that when there is a difference between the two the user might not even realise that
return [ | ||
...commands, | ||
...sizeToVisualDimensions(metadata, pathTree, ancestor), | ||
showToastCommand('Parent is set to fixed size', 'NOTICE', 'set-parent-to-fixed-size'), |
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.
I suspect we don't need this toast any more if we're providing this as an explicit option
Problem:
This is a followup PR to #4318
The goal was to make it optional to set the size of a hugging parent to fixed.
Fix:
sizeToVisualDimensions