Skip to content

Commit

Permalink
refactor(menu): better overflow handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLindh2 committed Sep 18, 2023
1 parent c65f225 commit cb40e0b
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import {
TAB_KEY_CODE,
} from '../../util/keycodes';

const zIndexStickyMenuSurfaceItem = '2';

interface MenuCrumbItem extends BreadcrumbItem {
menuItem: MenuItem;
}
Expand Down Expand Up @@ -257,6 +255,8 @@ export class Menu {
...cssProperties,
'--mdc-menu-min-width':
cssProperties['--menu-surface-width'],
'--limel-menu-surface-display': 'flex',
'--limel-menu-surface-flex-direction': 'column',
}}
class={{
'has-grid-layout': this.gridLayout,
Expand Down Expand Up @@ -322,20 +322,10 @@ export class Menu {
return;
}

let styleTop = '0';
if (this.searchInput) {
styleTop = this.searchInput?.offsetHeight?.toString() + 'px';
}

return (
<limel-breadcrumbs
style={{
'border-bottom': 'solid 1px rgb(var(--contrast-500))',
position: 'sticky',
top: styleTop,
'z-index': zIndexStickyMenuSurfaceItem,
'backdrop-filter': 'blur(0.5rem)',
'-webkit-backdrop-filter': 'blur(0.5rem)',
}}
onSelect={(
event: LimelBreadcrumbsCustomEvent<MenuCrumbItem>
Expand Down Expand Up @@ -375,11 +365,6 @@ export class Menu {
style={{
padding: '0.25rem',
'box-sizing': 'border-box',
position: 'sticky',
top: '0',
'z-index': zIndexStickyMenuSurfaceItem,
'backdrop-filter': 'blur(0.5rem)',
'-webkit-backdrop-filter': 'blur(0.5rem)',
}}
value={this.searchValue}
onChange={this.handlerTextInput}
Expand Down

0 comments on commit cb40e0b

Please sign in to comment.