-
Notifications
You must be signed in to change notification settings - Fork 28
[POC] list > content vertical alignment #6397
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
Note The build needs to finish before your changes are deployed. |
Oh yeah, the permutations are bananas. Measuring all the items initially and also whenever there are changes would be unfortunate. Does the indentation property not help us? I think it was intended to be our "escape hatch" since we were finding it difficult to address all the cases. |
Unfortunately, it only affects the margin before the drag handle, and the empty space gets added after that. For example, I tried setting |
I also tried placing the slots before the |
Yeah I've had |
|
@dbatiste I tried to fix Lessons by adding an icon to an expandable, but now its children are off. Do you have any ideas what we can do about this? https://github.com/Brightspace/smart-curriculum/pull/2857#issuecomment-3628271495
|


Problem/Motivation
In a specific case like the one in the screenshot above, where we have a mix of items with and without icons, we end up with a situation where the siblings look like they sit at different depths visually. The current logic reserves space in
D2#1to align it with its expandable sibling, which indeed works well when both items either have an icon or don't.Description
This POC PR is an attempt to implement vertical alignment of sibling items by their content. After trying a few versions of this feature, I realized it's not easy to implement without causing noticeable regressions. So this version keeps the current logic mostly untouched.
The idea is to calculate the distance from the start of each item to its content and take the largest value. Then, for all its siblings, we use a
spacerelement to make up the difference, which effectively aligns the space before the content.This PR is a small demo showing the concept.
Before:
After