- Replace `take(1)` with a full subscription stored in `_positionChangeSub`
so viewport resizes while the tooltip is open correctly update arrow
direction. The subscription is cleaned up in `_hide()`.
- Remove the `resolved !== this.position()` guard so that returning to
the preferred side after a flip correctly resets the arrow.
- Change `resolveTooltipPosition` to return `null` instead of silently
defaulting to `'top'`, so the caller skips the update on unknown
positions rather than rendering a potentially wrong arrow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BrnTooltip currently builds a CDK overlay position strategy with only a
single position and no fallbacks. When the trigger element is near a
viewport edge (e.g. a button in a top app bar with position="top"),
the tooltip overflows off-screen instead of flipping to the opposite
side.
This commit:
- Adds fallback positions so the CDK FlexibleConnectedPositionStrategy
tries the opposite side (and then the remaining two sides) when the
preferred position doesn't fit
- Adds withViewportMargin(8) to prevent tooltips from touching the
viewport edge
- Subscribes to positionChanges to update BrnTooltipContent's position
signal and arrow classes when the CDK resolves to a fallback position
- Exports BRN_TOOLTIP_FALLBACK_POSITIONS and resolveTooltipPosition
for consumers who need custom position logic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(navigation-menu): init brain
* feat(navigation-menu): init helm
* feat(navigation-menu): init inputs for root comp
* feat(navigation-menu): setup contexts and scaffolds comps WIP
* feat(cli): init trigger component
* feat(navigation-menu): init content comp and fix selectors
* feat(navigation-menu): create link comp and improve others
* feat(navigation-menu): create hlm directives WIP and export from index.ts
* feat(navigation-menu): start working on rendering content
* refactor(hover-card): move createHoverObservable to core
* feat(navigation-menu): init content service and rendering content WIP
* fix(hover-card): fix overlay position strategy position expression
* feat(navigation-menu): render content using angular cdk overlay WIP
* feat(navigation-menu): set delay duration on open
* feat(navigation-menu): show/hide content in all cases
* docs(navigation-menu): improve docs WIP
* feat(navigation-menu): move content related type to service class
* feat(navigation-menu): implement skip animation logic
* fix(navigation-menu): fix navigation mouse out behaviour
* docs(navigation-menu): add brain and helm api
* feat(navigation-menu): detach content on animation end
* refactor(navigation-menu): refactor setting data-motion logic
* docs(navigation-menu): add trigger chevron icon
* feat(navigation-menu): adjust content position
* docs(navigation-menu): add new badge
* feat(navigation-menu): support nested nav menu
* feat(navigation-menu): add missing orientation data attr
* feat(navigation-menu): add full support for dir and orientation
* fix(navigation-menu): apply dir to content overlay
* feat(navigation-menu): add support for tab and escape
* feat(navigation-menu): add hlm nav link
* feat(navigation-menu): close content on disabled item hover
* fix(navigation-menu): fix hover bug and rename variable
* fix(navigation-menu): add distinct hover
* fix(navigation-menu): fix animations and sub nav handling
* fix(navigation-menu): make button focusable in Safari, remove focused Observable
* feat(navigation-menu): implement keyboard focus
* feat(navigation-menu): comply with ARIA
* style: fix CSS popover and accent vars
* feat(navigation-menu): minor animation and render adjustments
* docs: write navigation menu docs WIP
* docs: remove redundant text
* docs: add navigation menu to storybook
* docs: modify nav menu example description
* docs: fix meta and title
* docs: remove accidentally added side nav content
* style: format
* fix(navigation-menu): fix token desc
* fix(tooltip): move computedPrevious to core
* fix(navigation-menu): expose isOpenDelayed as readonly
* fix(navigation-menu): rename hlmLink to hlmNavLink
* docs: update ui docs snapshot
* refactor: address lint issues
* chore: run format
* docs(navigation-menu): fix vertical menu width
* docs(navigation-menu): fix nested menu width
* fix(navigation-menu): resolve PR comments
* fix(navigation-menu): fix list styles
* fix(navigation-menu): add missing data-slot
* fix(navigation-menu): fix examples wrong href to docs
* feat(navigation-menu): add active input to link el
* feat: remove standalone property from various directives and components in the Helm UI library
* feat: enable strictStandalone option in Angular compiler settings