From b10f0747aebe61631576f41ac8af844a7a64d9aa Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 20 Aug 2018 15:04:07 +0100 Subject: [PATCH] Use input event not keyup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `oninput` event is a more performant way to detect changes to a textbox’s contents (compared to `onkeydown`, `onpaste`, etc). It’s not supported in older browsers, but since this is a likely to be used by platform admin users only that’s OK. --- app/assets/javascripts/colourPreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/colourPreview.js b/app/assets/javascripts/colourPreview.js index 58f975e4f..102c574b8 100644 --- a/app/assets/javascripts/colourPreview.js +++ b/app/assets/javascripts/colourPreview.js @@ -15,7 +15,7 @@ ); this.$input - .on('change keyup', this.update) + .on('input', this.update) .trigger('change'); };