Fix widget expansion behavior in Flow Part while editing ContentItem #17117
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.
This pull request addresses an unintended behavior where widgets inside flow parts expand by default when the flow part is expanded. The issue was caused by a change made in commit 1107fc1, which aimed to remove extra spacing around editing contents, flow, and bag parts.
The specific change that led to this unintended behavior was related to the modification of the collapsed class logic for widgets:
<div class="widget widget-editor card my-1 @(Model.Inline != true ? "collapsed" : "")">
This logic was altered in the commit to:
<div class="widget widget-editor card my-1 @(Model.Inline ? " collapsed" : String.Empty)">
This change caused widgets to expand by default when the flow part was expanded.
Fix:
I have corrected the behavior by updating the widget class assignment logic. The widget expansion now correctly follows the intended behavior.