From d18b549509e6fffda356570d9dc1f02b194df032 Mon Sep 17 00:00:00 2001 From: Jason Henriquez Date: Sun, 2 Jun 2024 20:42:09 -0500 Subject: [PATCH 01/18] Supplant mousedown handler for ft-icon-button --- .../components/ft-icon-button/ft-icon-button.js | 16 +++------------- .../components/ft-icon-button/ft-icon-button.vue | 9 +++++---- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/renderer/components/ft-icon-button/ft-icon-button.js b/src/renderer/components/ft-icon-button/ft-icon-button.js index 90ca0fb20f55..3d32ab000a0f 100644 --- a/src/renderer/components/ft-icon-button/ft-icon-button.js +++ b/src/renderer/components/ft-icon-button/ft-icon-button.js @@ -69,7 +69,6 @@ export default defineComponent({ data: function () { return { dropdownShown: false, - mouseDownOnIcon: false, useModal: false } }, @@ -111,24 +110,15 @@ export default defineComponent({ } }, - handleIconMouseDown: function () { - if (this.disabled) { return } - if (this.dropdownShown) { - this.mouseDownOnIcon = true - } - }, - handleDropdownFocusOut: function () { - if (this.mouseDownOnIcon) { - this.mouseDownOnIcon = false - } else if (!this.$refs.dropdown.matches(':focus-within')) { + if (this.dropdownShown && !this.$refs.ftIconButton.matches(':focus-within')) { this.dropdownShown = false } }, handleDropdownEscape: function () { - this.$refs.iconButton.focus() - // handleDropdownFocusOut will hide the dropdown for us + this.dropdownShown = false + this.$refs.ftIconButton.firstElementChild.focus() }, handleDropdownClick: function ({ url, index }) { diff --git a/src/renderer/components/ft-icon-button/ft-icon-button.vue b/src/renderer/components/ft-icon-button/ft-icon-button.vue index 4c6af4f0e3d4..27580a600930 100644 --- a/src/renderer/components/ft-icon-button/ft-icon-button.vue +++ b/src/renderer/components/ft-icon-button/ft-icon-button.vue @@ -1,7 +1,10 @@