From eb9a077520ad9fb147e3f56fae2f4851e2c63d30 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 19 Dec 2022 16:10:45 -0600 Subject: [PATCH] Fix scroll listener for multi select inputs --- client/components/ui/MultiSelect.vue | 4 ++-- client/components/ui/MultiSelectDropdown.vue | 4 ++-- client/components/ui/MultiSelectQueryInput.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/components/ui/MultiSelect.vue b/client/components/ui/MultiSelect.vue index 39094c2e..f2c542eb 100644 --- a/client/components/ui/MultiSelect.vue +++ b/client/components/ui/MultiSelect.vue @@ -117,7 +117,7 @@ export default { }, 50) }, recalcMenuPos() { - if (!this.menu) return + if (!this.menu || !this.$refs.inputWrapper) return var boundingBox = this.$refs.inputWrapper.getBoundingClientRect() if (boundingBox.y > window.innerHeight - 8) { // Input is off the page @@ -135,7 +135,7 @@ export default { this.menu.style.width = boundingBox.width + 'px' }, unmountMountMenu() { - if (!this.$refs.menu) return + if (!this.$refs.menu || !this.$refs.inputWrapper) return this.menu = this.$refs.menu var boundingBox = this.$refs.inputWrapper.getBoundingClientRect() diff --git a/client/components/ui/MultiSelectDropdown.vue b/client/components/ui/MultiSelectDropdown.vue index e10b4ee6..3baac572 100644 --- a/client/components/ui/MultiSelectDropdown.vue +++ b/client/components/ui/MultiSelectDropdown.vue @@ -68,14 +68,14 @@ export default { }, methods: { recalcMenuPos() { - if (!this.menu) return + if (!this.menu || !this.$refs.inputWrapper) return var boundingBox = this.$refs.inputWrapper.getBoundingClientRect() this.menu.style.top = boundingBox.y + boundingBox.height - 4 + 'px' this.menu.style.left = boundingBox.x + 'px' this.menu.style.width = boundingBox.width + 'px' }, unmountMountMenu() { - if (!this.$refs.menu) return + if (!this.$refs.menu || !this.$refs.inputWrapper) return this.menu = this.$refs.menu var boundingBox = this.$refs.inputWrapper.getBoundingClientRect() diff --git a/client/components/ui/MultiSelectQueryInput.vue b/client/components/ui/MultiSelectQueryInput.vue index e8589d83..4c28cae2 100644 --- a/client/components/ui/MultiSelectQueryInput.vue +++ b/client/components/ui/MultiSelectQueryInput.vue @@ -140,7 +140,7 @@ export default { }, 50) }, recalcMenuPos() { - if (!this.menu) return + if (!this.menu || !this.$refs.inputWrapper) return var boundingBox = this.$refs.inputWrapper.getBoundingClientRect() if (boundingBox.y > window.innerHeight - 8) { // Input is off the page @@ -158,7 +158,7 @@ export default { this.menu.style.width = boundingBox.width + 'px' }, unmountMountMenu() { - if (!this.$refs.menu) return + if (!this.$refs.menu || !this.$refs.inputWrapper) return this.menu = this.$refs.menu var boundingBox = this.$refs.inputWrapper.getBoundingClientRect()