Fixes filters panel hidding on mobile after opening autocomplete filter.

This commit is contained in:
mateuswetah 2023-11-27 11:46:46 -03:00
parent 406fe390ec
commit 303d36c39d
3 changed files with 11 additions and 3 deletions

View File

@ -264,7 +264,7 @@
this.selected.push(newSelected);
}
},
width: 'calc(100% - (4 * var(--tainacan-one-column)))',
width: 'max(768px, calc(100% - (4 * var(--tainacan-one-column))))',
trapFocus: true,
customClass: 'tainacan-modal',
closeButtonAriaLabel: this.$i18n.get('close')

View File

@ -4,6 +4,11 @@
@media screen and (max-width: 769px) {
justify-content: flex-end;
.tainacan-modal-content {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
}
}
.tainacan-modal .animation-content {

View File

@ -1425,13 +1425,16 @@
if (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) {
const previousMobileScreen = this.isMobileScreen;
const previousWindowWidth = this.windowWidth;
this.windowWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);
this.isMobileScreen = this.windowWidth <= 768;
// The window size didn't changed (the resize event is triggered by scrolls on mobile)
if (previousWindowWidth == this.windowWidth)
return;
if ( // We DO NOT want to open the filters due to this resize event IF:
(!previousMobileScreen && this.isMobileScreen) || // We're coming from a non-mobile screen to a mobile screen, or
(previousWindowWidth == this.windowWidth) || // The window size didn't changed (the resize event is triggered by scrolls on mobile), or
this.startWithFiltersHidden || // Filters should begin disabled, or
this.openAdvancedSearch // Advanced search is opened
)