Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this early return condition needs to be fixed. It should probably return
null
when bothallowJustification
andallowVerticalAlignment
arefalse
.@ntsekouras, can you confirm? I think you worked on the initial implementation of this feature.
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.
It's been so long and even by looking at old PRs, I'm still not 100% sure why this check was added. If I remember correctly at that time we explicitly didn't want to show the justification controls in inspector controls too. Having said that, back then there were fewer layout props and there was no vertical alignment.
The
allowJustification
prop was added specifically for constraint layout but in docs says that can also be applied toflex
and defaults totrue
. There are no checks for it now inflex
layout, so I guess we need to take into account both ininspectorControls
andtoolBarControls
.So, I'm not sure whether the
allowSwitching
check is still needed, but the other checks (allowVerticalAlignment, allowJustification
) should be added.I'll cc @tellthemachines if she has more context.
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 don't have any further context but agree this check isn't the right one here.
One thing I'm noticing now is that setting
allowJustification
to false doesn't actually disable the justification controls for flex layout either in the toolbar or the sidebar. That should also be addressed, but not necessarily as part of this PR.Given that this change by itself fixes #67016 and doesn't affect anything else, I'm ok with merging this as is and fixing the justification controls separately.