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 widget expansion behavior in Flow Part while editing ContentItem #17117

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Karthikeyan-tv
Copy link

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.

Copy link
Contributor

github-actions bot commented Dec 4, 2024

Thank you for submitting your first pull request, awesome! 🚀 If you haven't already, please take a moment to review our contribution guide. This guide provides helpful information to ensure your contribution aligns with our standards. A core team member will review your pull request.

If you like Orchard Core, please star our repo and join our community channels.

@Karthikeyan-tv
Copy link
Author

@dotnet-policy-service agree

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Dec 4, 2024

@Karthikeyan-tv Thank you for your contribution! I

believe it would be beneficial to implement this as a toggleable setting. Some users may prefer the items in the BagPart to be collapsed by default, while others may not want this behavior.

Could you add a setting in BagPartSettings and FlowPartSettings?

The setting could be called AutoCollapseContainedItems, with a default value of true (reflecting the current behavior). This would allow users to modify this behavior via the settings if desired.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants