From 7a3b171f7f018aaa5ba181886e547bbec9df422f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 14 Jul 2021 15:59:27 +0100 Subject: [PATCH] Fixed error when interacting with tag accent color input closes https://github.com/TryGhost/Team/issues/744 - we were using `{{on}}` with a function on the component that wasn't bound to `this` via the `action` decorator meaning errors were thrown every time the input lost focus --- ghost/admin/app/components/gh-tag-settings-form.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/gh-tag-settings-form.js b/ghost/admin/app/components/gh-tag-settings-form.js index 59a6e2d2ec..42838fdac9 100644 --- a/ghost/admin/app/components/gh-tag-settings-form.js +++ b/ghost/admin/app/components/gh-tag-settings-form.js @@ -1,5 +1,6 @@ import Component from '@ember/component'; import Ember from 'ember'; +import {action} from '@ember/object'; import {computed} from '@ember/object'; import {htmlSafe} from '@ember/template'; import {or} from '@ember/object/computed'; @@ -161,7 +162,7 @@ export default Component.extend({ } }, - updateAccentColor: async function (event) { + updateAccentColor: action(async function (event) { let newColor = event.target.value; const oldColor = this.tag.get('accentColor'); @@ -199,7 +200,7 @@ export default Component.extend({ this.tag.errors.add('accentColor', 'The colour should be in valid hex format'); this.tag.hasValidated.pushObject('accentColor'); } - }, + }), debounceUpdateAccentColor: task(function*(event) { yield timeout(10);