Skip to content

Commit

Permalink
fix(combobox-item): bumping the scale of icon to M when parent combob…
Browse files Browse the repository at this point in the history
…ox is scale L (#6253)

**Related Issue:** #5698

Bumping the scale of the icon to M when the parent `combobox-item` is
scale="l" for a visual distinction between larger and smaller components
without affecting the height of the `combobox-item` when icon(s) are
added or removed. Added a _testOnly snapshot.
  • Loading branch information
Elijbet authored Jan 11, 2023
1 parent 4f22f97 commit 051cb3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/combobox-item/combobox-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class ComboboxItem implements ConditionalSlotComponent, InteractiveCompon

isNested: boolean;

/** Specifies the scale of the combobox-item controlled by parent, defaults to m */
scale: Scale = "m";

// --------------------------------------------------------------------------
Expand Down Expand Up @@ -168,7 +169,7 @@ export class ComboboxItem implements ConditionalSlotComponent, InteractiveCompon
}}
flipRtl={iconFlipRtl}
icon={icon || iconPath}
scale="s"
scale={this.scale === "l" ? "m" : "s"}
/>
);
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/combobox/combobox.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,18 @@ export const optionListMinWidthMatchesInputWhenOverlayPositioningIsFixed_TestOnl
</calcite-combobox>
</div>
`;

export const mediumIconForLargeComoboboxItem_TestOnly = (): string => html`
<calcite-combobox open scale="l">
<calcite-combobox-item
icon="altitude"
value="altitude"
text-label="Altitude"
selected
scale="l"
></calcite-combobox-item>
<calcite-combobox-item icon="article" value="article" text-label="Article" scale="l"></calcite-combobox-item>
<calcite-combobox-item value="altitude" text-label="Altitude" scale="l"></calcite-combobox-item>
<calcite-combobox-item value="article" text-label="Article" scale="l"></calcite-combobox-item>
</calcite-combobox>
`;

0 comments on commit 051cb3f

Please sign in to comment.