Fix search out of viewport on mobile (#6954)

This commit is contained in:
Yuriy Bakhtin 2024-04-19 15:57:58 +02:00 committed by GitHub
parent ba9e87eba0
commit 1e50f6f978
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -345,8 +345,8 @@ humhub.module('ui.search', function(module, require, $) {
// Centralize panel if it is over window
const menuTogglerLeft = this.getMenuToggler().offset().left;
const currentTogglerLeft = this.getCurrentToggler().offset().left;
const windowWidth = $(window).width();
const panelWidth = this.getPanel().width();
const windowWidth = Math.round($(window).width());
const panelWidth = Math.round(this.getPanel().width());
let isPanelShifted = false;
if (menuTogglerLeft === currentTogglerLeft) {
this.getPanel().css('left', '');