From 319df1e932a0c026254d9422376866dbb7193580 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Thu, 2 Jun 2022 13:17:02 +0100 Subject: [PATCH] Fixed #2618 - The overlay elements automatically close on mobile devices --- src/components/autocomplete/AutoComplete.vue | 2 +- src/components/calendar/Calendar.vue | 2 +- src/components/cascadeselect/CascadeSelect.vue | 2 +- src/components/colorpicker/ColorPicker.vue | 2 +- src/components/confirmpopup/ConfirmPopup.vue | 2 +- src/components/contextmenu/ContextMenu.vue | 2 +- src/components/datatable/ColumnFilter.vue | 2 +- src/components/menu/Menu.vue | 2 +- src/components/multiselect/MultiSelect.vue | 2 +- src/components/overlaypanel/OverlayPanel.vue | 2 +- src/components/password/Password.vue | 2 +- src/components/tieredmenu/TieredMenu.vue | 2 +- src/components/tooltip/Tooltip.js | 2 +- src/components/treeselect/TreeSelect.vue | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/autocomplete/AutoComplete.vue b/src/components/autocomplete/AutoComplete.vue index 4f149db8f..71a2991e2 100755 --- a/src/components/autocomplete/AutoComplete.vue +++ b/src/components/autocomplete/AutoComplete.vue @@ -250,7 +250,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.hideOverlay(); } }; diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index 22c78045e..d3c69b602 100755 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -768,7 +768,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible && !DomHandler.isAndroid()) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.overlayVisible = false; } }; diff --git a/src/components/cascadeselect/CascadeSelect.vue b/src/components/cascadeselect/CascadeSelect.vue index 44f385c1d..c63c279fe 100644 --- a/src/components/cascadeselect/CascadeSelect.vue +++ b/src/components/cascadeselect/CascadeSelect.vue @@ -243,7 +243,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.hide(); } }; diff --git a/src/components/colorpicker/ColorPicker.vue b/src/components/colorpicker/ColorPicker.vue index 30fd47dff..9f40e4912 100755 --- a/src/components/colorpicker/ColorPicker.vue +++ b/src/components/colorpicker/ColorPicker.vue @@ -502,7 +502,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.overlayVisible = false; } }; diff --git a/src/components/confirmpopup/ConfirmPopup.vue b/src/components/confirmpopup/ConfirmPopup.vue index 8cd4feb5d..cd363cdb4 100644 --- a/src/components/confirmpopup/ConfirmPopup.vue +++ b/src/components/confirmpopup/ConfirmPopup.vue @@ -165,7 +165,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.visible) { + if (this.visible && !DomHandler.isTouchDevice()) { this.visible = false; } }; diff --git a/src/components/contextmenu/ContextMenu.vue b/src/components/contextmenu/ContextMenu.vue index acd1f118e..642a3a51a 100755 --- a/src/components/contextmenu/ContextMenu.vue +++ b/src/components/contextmenu/ContextMenu.vue @@ -169,7 +169,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.visible) { + if (this.visible && !DomHandler.isTouchDevice()) { this.hide(); } }; diff --git a/src/components/datatable/ColumnFilter.vue b/src/components/datatable/ColumnFilter.vue index 59003cf36..c6402b6b7 100644 --- a/src/components/datatable/ColumnFilter.vue +++ b/src/components/datatable/ColumnFilter.vue @@ -435,7 +435,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.hide(); } }; diff --git a/src/components/menu/Menu.vue b/src/components/menu/Menu.vue index 59a5e70d3..d0e100c5e 100755 --- a/src/components/menu/Menu.vue +++ b/src/components/menu/Menu.vue @@ -176,7 +176,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.hide(); } }; diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index 74407f58e..711b65990 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -495,7 +495,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible && !DomHandler.isAndroid()) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.hide(); } }; diff --git a/src/components/overlaypanel/OverlayPanel.vue b/src/components/overlaypanel/OverlayPanel.vue index 459c1ed08..a793acb46 100755 --- a/src/components/overlaypanel/OverlayPanel.vue +++ b/src/components/overlaypanel/OverlayPanel.vue @@ -203,7 +203,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.visible && !DomHandler.isAndroid()) { + if (this.visible && !DomHandler.isTouchDevice()) { this.visible = false; } }; diff --git a/src/components/password/Password.vue b/src/components/password/Password.vue index 4b309c035..af0c608d3 100755 --- a/src/components/password/Password.vue +++ b/src/components/password/Password.vue @@ -227,7 +227,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.overlayVisible = false; } }; diff --git a/src/components/tieredmenu/TieredMenu.vue b/src/components/tieredmenu/TieredMenu.vue index ffe9957af..44b91f16e 100755 --- a/src/components/tieredmenu/TieredMenu.vue +++ b/src/components/tieredmenu/TieredMenu.vue @@ -148,7 +148,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.visible) { + if (this.visible && !DomHandler.isTouchDevice()) { this.hide(); } }; diff --git a/src/components/tooltip/Tooltip.js b/src/components/tooltip/Tooltip.js index 5bf836b0b..80425b237 100755 --- a/src/components/tooltip/Tooltip.js +++ b/src/components/tooltip/Tooltip.js @@ -72,7 +72,7 @@ function show(el) { DomHandler.fadeIn(tooltipElement, 250); window.addEventListener('resize', function onWindowResize() { - if (!DomHandler.isAndroid()) { + if (!DomHandler.isTouchDevice()) { hide(el); } this.removeEventListener('resize', onWindowResize); diff --git a/src/components/treeselect/TreeSelect.vue b/src/components/treeselect/TreeSelect.vue index 7eed365d5..04558d5f8 100644 --- a/src/components/treeselect/TreeSelect.vue +++ b/src/components/treeselect/TreeSelect.vue @@ -276,7 +276,7 @@ export default { bindResizeListener() { if (!this.resizeListener) { this.resizeListener = () => { - if (this.overlayVisible) { + if (this.overlayVisible && !DomHandler.isTouchDevice()) { this.hide(); } };