Skip to main content

EqualizeController

Purpose​

This controller will equalize the heights of all watchTargets that are connected to the controller so that they are all the same height.

Note: For the majority of use-cases, Flexbox is a better solution than this controller, but this can be used as a fallback in contexts where third-party libraries mean that flexbox doesn't work or your CSS system doesn't support flexbox.

Actions​

ActionPurpose
--

Targets​

TargetPurposeDefault
watchThe DOM element(s) to watch-

Classes​

ClassPurposeDefault
---

Values​

ValueTypeDescriptionDefault
----

Events​

EventWhenDispatched onevent.detail
----

Side Effects​

  • Uses a ResizeObserver to observe all watched elements.
  • Sets the style.minHeight property on all watched element to the calculated maximum height of all observed elements.

How to Use​