Skip to content

Add support for overflow in vertical orientation avatar group #14550

Open

Description

@MariaIDineva

Describe your proposal

The fd-avatar-group component currently supports overflow only in horizontal orientation. When orientation="vertical" is used, the group does not detect container height constraints and never triggers the overflow button — all avatars are always rendered regardless of available vertical space.

Expected behavior

In vertical orientation, the avatar group should:

  • Monitor the container height (instead of width) to determine how many avatars fit
  • Show the +N overflow button when avatars exceed the available vertical space
  • Respect the existing maxVisibleItems input as a hard cap, consistent with horizontal behavior
  • Preserve keyboard navigation and accessibility (roving tabindex, aria-posinset/setsize) for the visible subset

Current behavior

The overflow calculation in AvatarGroupHostComponent uses item widths and container width exclusively. In vertical mode, items stack along the block axis, so the width-based logic never hides any items and the overflow button is never shown.

Acceptance criteria

  • Vertical individual-type avatar group clips to available container height and shows the overflow button with hidden count
  • maxVisibleItems still works as a hard cap in vertical orientation
  • Overflow popover opens and shows the hidden avatars (same as horizontal)
  • Keyboard navigation works correctly for visible avatars and the overflow button
  • No regression in horizontal orientation or group type

Notes

The resize observer hook (fdkResizeObserver) is already applied to the host. The main change is in AvatarGroupHostComponent._calculateVisibility — it needs to branch on orientation and use item heights + container height when orientation="vertical".

Proposed Alternatives

No response

Organization

No response

StackBlitz example(s)

No response

Priority

None

Declaration

  • I'm not disclosing any internal or sensitive information.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions