Skip to content

Commit

Permalink
feat(action-menu): set max height of the action menu (#8275)
Browse files Browse the repository at this point in the history
**Related Issue:** #8274

## Summary

- Sets max-height on action-menu and applies overflow if necessary
- Adds screenshot test
  • Loading branch information
driskull authored Nov 28, 2023
1 parent a30424f commit ca1be28
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
}

.menu {
@apply flex-col flex-nowrap outline-none;
@apply flex-col
flex-nowrap
outline-none
overflow-y-auto
overflow-x-hidden
max-h-menu;
}

@include base-component();
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,29 @@ export const keyDownOpen_TestOnly = (): string =>
</script>
`;

export const openMaxHeight_TestOnly = (): string =>
html`
<calcite-action-menu open>
<calcite-action slot="trigger" text="Add" icon="banana"></calcite-action>
<calcite-action text="Plus" icon="plus" text-enabled></calcite-action>
<calcite-action text="Minus" icon="minus" text-enabled></calcite-action>
<calcite-action text="Table" icon="table" text-enabled></calcite-action>
<calcite-action text="Plus" icon="plus" text-enabled></calcite-action>
<calcite-action text="Minus" icon="minus" text-enabled></calcite-action>
<calcite-action text="Table" icon="table" text-enabled></calcite-action>
<calcite-action text="Plus" icon="plus" text-enabled></calcite-action>
<calcite-action text="Minus" icon="minus" text-enabled></calcite-action>
<calcite-action text="Table" icon="table" text-enabled></calcite-action>
<calcite-action text="Plus" icon="plus" text-enabled></calcite-action>
<calcite-action text="Minus" icon="minus" text-enabled></calcite-action>
<calcite-action text="Table" icon="table" text-enabled></calcite-action>
<calcite-action text="Plus" icon="plus" text-enabled></calcite-action>
<calcite-action text="Minus" icon="minus" text-enabled></calcite-action>
<calcite-action text="Table" icon="table" text-enabled></calcite-action>
<calcite-action text="Plus" icon="plus" text-enabled></calcite-action>
<calcite-action text="Minus" icon="minus" text-enabled></calcite-action>
<calcite-action text="Table" icon="table" text-enabled></calcite-action>
</calcite-action-menu>
`;

keyDownOpen_TestOnly.parameters = { chromatic: { delay: 1000 } };

0 comments on commit ca1be28

Please sign in to comment.