Files
Robin Goetz 98716770ca feat: make menu open animations scale from the anchored corner (#1547)
* feat: make menu open animations scale from the anchored corner

CDK menus (dropdown, context, menubar) zoomed in from a fixed center because no
transform-origin was ever set. Let CDK set it from the resolved, direction-aware position
through its transformOriginSelector input, so the open animation now scales out of the
corner anchored to the trigger - matching shadcn/Radix.

Derive the content's data-side from that same CDK transform-origin and delete the
_spartanLastPosition / setSideWithDarkMagic workaround that reached into CDK internals on a
setTimeout. CDK's origin is RTL-aware, so the slide-in direction is now correct in RTL too.

Adds a Submenu data-side e2e and keeps the existing menu specs green.

* fix: derive menu data-side from each trigger's configured side

The content derived its data-side axis from an isRoot heuristic, which assumed
roots are placed vertically and submenus horizontally. A root menu configured
with side left/right (or a submenu with top/bottom) then read the wrong
transform-origin token and reported the wrong side.

Each trigger now provides its configured side through CDK's child injector to
the portaled content, which picks the transform-origin axis from that side.
Drops the now-dead isRoot branch in the submenu content and the missing-origin
guard so the helper applies its own fallback.

Adds unit coverage for the derivation plus a real-browser spec proving the
configured side reaches the content through DI.
2026-06-23 22:46:05 +02:00
..
2025-01-08 23:12:22 +01:00

@spartan-ng/brain/core

Secondary entry point of @spartan-ng/brain. It can be used by importing from @spartan-ng/brain/core.