Changes since adding notifications would cause direction to be assessed
upon max height of 80vh, which caused large dropdowns like the audit log
dropdown to drop up and/or go offscreen.
This restores the default assessment of 500px, and adds dynamic
max-height adjustment to provide more room for large dropdowns.
For #4652
let heightOffset = 0;
const toggleHeight = this.toggle.getBoundingClientRect().height;
const dropUpwards = menuOriginalRect.bottom > window.innerHeight;
let heightOffset = 0;
const toggleHeight = this.toggle.getBoundingClientRect().height;
const dropUpwards = menuOriginalRect.bottom > window.innerHeight;
+ const containerRect = this.container.getBoundingClientRect();
// If enabled, Move to body to prevent being trapped within scrollable sections
if (this.moveMenu) {
// If enabled, Move to body to prevent being trapped within scrollable sections
if (this.moveMenu) {
if (dropUpwards) {
this.menu.style.top = 'initial';
this.menu.style.bottom = `${heightOffset}px`;
if (dropUpwards) {
this.menu.style.top = 'initial';
this.menu.style.bottom = `${heightOffset}px`;
+ const maxHeight = (window.innerHeight - 40) - (window.innerHeight - containerRect.bottom);
+ this.menu.style.maxHeight = `${Math.floor(maxHeight)}px`;
} else {
this.menu.style.top = `${heightOffset}px`;
this.menu.style.bottom = 'initial';
} else {
this.menu.style.top = `${heightOffset}px`;
this.menu.style.bottom = 'initial';
+ const maxHeight = (window.innerHeight - 40) - containerRect.top;
+ this.menu.style.maxHeight = `${Math.floor(maxHeight)}px`;
}
// Set listener to hide on mouse leave or window click
}
// Set listener to hide on mouse leave or window click
this.toggle.setAttribute('aria-expanded', 'false');
this.menu.style.top = '';
this.menu.style.bottom = '';
this.toggle.setAttribute('aria-expanded', 'false');
this.menu.style.top = '';
this.menu.style.bottom = '';
+ this.menu.style.maxHeight = '';
if (this.moveMenu) {
this.menu.style.position = '';
if (this.moveMenu) {
this.menu.style.position = '';
@include lightDark(color, #555, #eee);
fill: currentColor;
text-align: start !important;
@include lightDark(color, #555, #eee);
fill: currentColor;
text-align: start !important;
overflow-y: auto;
&.anchor-left {
inset-inline-end: auto;
overflow-y: auto;
&.anchor-left {
inset-inline-end: auto;
<input type="hidden" name="{{ $key }}" value="{{ $val }}">
@endforeach
<input type="hidden" name="{{ $key }}" value="{{ $val }}">
@endforeach
- <div component="dropdown" class="list-sort-type dropdown-container">
+ <div component="dropdown" class="list-sort-type dropdown-container relative">
<label for="">{{ trans('settings.audit_event_filter') }}</label>
<button refs="dropdown@toggle"
type="button"
<label for="">{{ trans('settings.audit_event_filter') }}</label>
<button refs="dropdown@toggle"
type="button"