remove flipFallback(Placement|Strategy) as we get a better/working placement without

now clicks close to right end of the window open to the left (and not outside as before)

(cherry picked from commit 5ea8f27d9dc62e94e19a4307e1e363e66373ba46)
This commit is contained in:
ralf 2024-08-13 15:53:00 +02:00 committed by milan
parent ca571c45c9
commit bff869f93d

View File

@ -26,7 +26,7 @@ export class EgwMenuShoelace extends LitElement
} }
sl-menu-item::part(base) { sl-menu-item::part(base) {
height: 1.6em; height: 1.7em;
line-height: var(--sl-line-height-dense); line-height: var(--sl-line-height-dense);
align-items: center; align-items: center;
padding: 0; padding: 0;
@ -48,7 +48,7 @@ export class EgwMenuShoelace extends LitElement
et2-image { et2-image {
line-height: normal; line-height: normal;
width: 1.5em; width: 1.3em;
} }
` `
] ]
@ -117,11 +117,9 @@ export class EgwMenuShoelace extends LitElement
if(this.popup == null) if(this.popup == null)
{ {
this.popup = Object.assign(document.createElement("sl-popup"), { this.popup = Object.assign(document.createElement("sl-popup"), {
placement: "top", placement: "right-start",
autoSize: "vertical", autoSize: "vertical",
flip: true, flip: true,
flipFallbackPlacements: "right bottom",
flipFallbackStrategy: "initial",
shift: true shift: true
}); });
this.popup.append(this); this.popup.append(this);
@ -134,7 +132,7 @@ export class EgwMenuShoelace extends LitElement
return { return {
x: _x, x: _x,
y: _y, y: _y,
width: menu.clientWidth, width: 0, // placement="right-start" only works well with 0, not menu.clientWidth,
height: menu.clientHeight, height: menu.clientHeight,
top: _y, top: _y,
left: _x, left: _x,
@ -260,7 +258,7 @@ export class EgwMenuShoelace extends LitElement
> >
${item.iconUrl ? html` ${item.iconUrl ? html`
<et2-image slot="prefix" src="${item.iconUrl}"></et2-image>` : nothing} <et2-image slot="prefix" src="${item.iconUrl}"></et2-image>` : nothing}
${item.caption} <span style="color: ${item.color || nothing}">${item.caption}</span>
${item.shortcutCaption ? html`<span slot="suffix" ${item.shortcutCaption ? html`<span slot="suffix"
class="keyboard_shortcut"> class="keyboard_shortcut">
${item.shortcutCaption} ${item.shortcutCaption}