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 @@