From 5de0ae5cea817f2d4045f394c847fb485da191e3 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 23 Apr 2018 14:25:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20tag/author=20removal=20i?= =?UTF-8?q?n=20post=20settings=20removing=20multiple=20tags/authors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/9575 - in https://github.com/kevinansfield/Ghost-Admin/commit/6a3cfc2ca8e40cae47f904105d8c5a6cdc25d88f an `onmouseover` event handler was added for the close button in token input options which resulted in double firing in some circumstances where our code fired then the ember-power-select removal event handler also fired --- ghost/admin/app/components/gh-token-input/trigger.js | 8 +++++--- .../app/templates/components/gh-token-input/trigger.hbs | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ghost/admin/app/components/gh-token-input/trigger.js b/ghost/admin/app/components/gh-token-input/trigger.js index ed378d3215..7e0caa7b7f 100644 --- a/ghost/admin/app/components/gh-token-input/trigger.js +++ b/ghost/admin/app/components/gh-token-input/trigger.js @@ -12,9 +12,11 @@ export default EmberPowerSelectMultipleTrigger.extend({ }, handleOptionMouseDown(event) { - let action = this.get('extra.optionMouseDown'); - if (action) { - return action(event); + if (!event.target.closest('[data-selected-index]')) { + let action = this.get('extra.optionMouseDown'); + if (action) { + return action(event); + } } }, diff --git a/ghost/admin/app/templates/components/gh-token-input/trigger.hbs b/ghost/admin/app/templates/components/gh-token-input/trigger.hbs index afafdd53de..877d0e556d 100644 --- a/ghost/admin/app/templates/components/gh-token-input/trigger.hbs +++ b/ghost/admin/app/templates/components/gh-token-input/trigger.hbs @@ -27,7 +27,6 @@ aria-label="remove element" class="ember-power-select-multiple-remove-btn" data-selected-index={{idx}} - onmousedown={{action "chooseOption" opt}} > {{svg-jar "close" data-selected-index=idx}}