components icon indicating copy to clipboard operation
components copied to clipboard

feat(mat-select): add smart panel width based on trigger and largest option size

Open Harpush opened this issue 1 year ago • 0 comments
trafficstars

Feature Description

Currently panelWidth can be one of three:

  1. Trigger width
  2. Largest option width
  3. Custom provided width in numbers

What I am missing is - minimum width as trigger width and grow until max option size (if needed)

Use Case

When having dynamic options texts sometimes they might be larger than trigger width and I want the largest option behavior. Sometimes they are smaller than trigger width and I want the trigger width behavior to avoid really small select panels. Which means I actually need: min panel width = trigger width with potential grow (not shrink!) to the largest option width.

Can be with a new panelWidth option or even minPanelWidth input (can have a complimenting maxPanelWidth too for completeness)

Harpush avatar Aug 12 '24 07:08 Harpush