We should provide some kind of "equal height groups". To do so Foundation provides the Equalizer script: https://get.foundation/sites/docs/equalizer.html

Equal Height Group:
- A boolean / checkbox: "Equalize height with sibling contents" => Automatically find other childrens inside this container
- An additional "Height Group Name/ID" text - or even better - autocomplete (with existing values) field, to define custom groups, if the automatism fails

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

thomas.frobieter created an issue. See original summary.

anybody’s picture

Priority: Normal » Minor
Status: Active » Postponed

I'll postpone this for the future... after upgrades to 4.x are solved.

thomas.frobieter’s picture

This becomes more.. important now, because a customer asked for this feature.

An additional "Height Group Name/ID" text - or even better - autocomplete (with existing values) field, to define custom groups, if the automatism fails

Reading the ideas here again, my favorite is this solution, because its very flexible to use. Gave the same "groupname" to each paragraph which should have the same height, JS detects the heighest one and updates an according CSS variable. No brainer. We might need to update this on screen resize (https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).

Improving the min-height setting is also a thing, but not that important, and of course not a replacement for this JS solution.

anybody’s picture

Assigned: thomas.frobieter » anybody
Priority: Minor » Normal
Status: Postponed » Active

Okay, let's implement this. Autocomplete would make sense, but will cost some time to implement, so this might be a follow-up (for in years, not months ;)).

I'll prepare a MR.

anybody’s picture

Assigned: anybody » thomas.frobieter
Status: Active » Needs review

@thomas.frobieter here we go (untested!)

I added the field, its schema and it's now added as data-equal-height-group="VALUE" attribute.
I wasn't sure about that part, but at least that should make clear, how to use it. Perhaps that kind of neutral attribute is also a good idea, or perhaps not.

I guess you can now make the next steps from here.

Everything else not implemented here, but still making sense, should then be transfered into a separate follow-up task, so we can close this one fixed when the feature is merged.

thomas.frobieter’s picture

Assigned: thomas.frobieter » anybody
Status: Needs review » Active

Sounds very good, data-attribute is exactly what I've imagined. I'll add the JS part and we are done :)

I agree, we should split the other ideas into seperate tasks, I will do this later!

thomas.frobieter’s picture

Assigned: anybody » thomas.frobieter
thomas.frobieter’s picture

Assigned: thomas.frobieter » anybody

Done! Please review :)

We might should improve it.. by also comparing the getBoundingClientRect().top values inside one group. This would be a pretty simple streightforward way to make this more mobile friendly, by adressing only the current layout row, instead of all cells in all rows... mhm.

So the object would be something like: equalHeightGroups.groupName.clientRectTopValue.NodeList .. then we loop and equalize these "row-groups" instead the full NodeList of the group.

Or.. simply use THIS o.O https://dev.to/dhruvangg/equal-height-in-vanilla-javascript-49ch

anybody’s picture

Assigned: anybody » thomas.frobieter
Status: Active » Needs work

@thomas.frobieter review done! Nice work! :)

Please fix the clear issues and afterwards please assign @Grevil for his comments. I don't have the time to check for the correct implementation details in the loops. But we should be 100% sure to use it correctly for performance and functionality reasons.

thomas.frobieter’s picture

Assigned: thomas.frobieter » grevil
Status: Needs work » Needs review

Grevil made their first commit to this issue’s fork.

grevil’s picture

Status: Needs review » Reviewed & tested by the community

LGTM! Just a few minor adjustments. :)

grevil’s picture

Status: Reviewed & tested by the community » Needs work

Uncaught TypeError: el.style is undefined

thomas.frobieter’s picture

Status: Needs work » Fixed
thomas.frobieter’s picture

Title: Improve the min-height setting (?) & add an equal height setting » Add an equal height setting
Issue summary: View changes

Updated Issue description and moved the min-height setting improvements to: https://www.drupal.org/project/drowl_paragraphs/issues/3342355

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.