mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-18 10:14:43 +00:00
fix(ui): position table dropdowns outside overflowing containers
Update Coolify release metadata to version 4.3.7 and nightly 4.3.8.
This commit is contained in:
1 parent
84021504b3
commit
70b9acc424
7 files changed
+51
-14
No files matched your search
@@ -4,13 +4,36 @@
|
||||
'multiselectable' => false,
|
||||
])
|
||||
|
||||
<div class="relative" x-data="{ open: false }" @click.outside="open = false" @keydown.escape.window="open = false">
|
||||
<div @click="open = !open">
|
||||
<div class="relative" x-data="{
|
||||
open: false,
|
||||
panelStyle: 'display: none;',
|
||||
toggle() {
|
||||
this.open = !this.open;
|
||||
|
||||
if (this.open) {
|
||||
this.$nextTick(() => this.updatePosition());
|
||||
}
|
||||
},
|
||||
updatePosition() {
|
||||
const trigger = this.$refs.trigger.getBoundingClientRect();
|
||||
const panel = this.$refs.panel.getBoundingClientRect();
|
||||
const viewportPadding = 8;
|
||||
const left = Math.max(viewportPadding, Math.min(trigger.right - panel.width, window.innerWidth - panel.width - viewportPadding));
|
||||
const spaceBelow = window.innerHeight - trigger.bottom - viewportPadding;
|
||||
const top = spaceBelow >= panel.height
|
||||
? trigger.bottom + 4
|
||||
: Math.max(viewportPadding, trigger.top - panel.height - 4);
|
||||
|
||||
this.panelStyle = `position: fixed; left: ${left}px; top: ${top}px;`;
|
||||
}
|
||||
}" @click.outside="open = false" @keydown.escape.window="open = false"
|
||||
x-on:resize.window="if (open) updatePosition()" x-on:scroll.window="if (open) updatePosition()">
|
||||
<div x-ref="trigger" @click="toggle()">
|
||||
{{ $trigger }}
|
||||
</div>
|
||||
|
||||
<div x-show="open" x-cloak
|
||||
class="listbox-panel absolute top-full! right-0! left-auto! mt-1! {{ $panelClass }}" role="{{ $role }}"
|
||||
<div x-ref="panel" x-show="open" x-cloak :style="panelStyle"
|
||||
class="listbox-panel fixed! top-auto! right-auto! bottom-auto! z-[90]! mt-0! {{ $panelClass }}" role="{{ $role }}"
|
||||
@if ($multiselectable) aria-multiselectable="true" @endif>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user