From 5799a877a9ea909f8fadc51bbe734551e6dc5eae Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Fri, 24 Jul 2020 17:50:58 +0200 Subject: [PATCH] Fix alphaPicker --- src/components/alphaPicker/alphaPicker.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/alphaPicker/alphaPicker.js b/src/components/alphaPicker/alphaPicker.js index bd11afc7f..afdee9760 100644 --- a/src/components/alphaPicker/alphaPicker.js +++ b/src/components/alphaPicker/alphaPicker.js @@ -126,13 +126,12 @@ import 'material-icons'; let alphaFocusedElement; let alphaFocusTimeout; - function onAlphaFocusTimeout() { - + function onAlphaFocusTimeout(instance) { alphaFocusTimeout = null; if (document.activeElement === alphaFocusedElement) { const value = alphaFocusedElement.getAttribute('data-value'); - this.value(value, true); + instance.value(value, true); } } @@ -177,7 +176,7 @@ import 'material-icons'; if (alphaPickerButton) { alphaFocusedElement = alphaPickerButton; - alphaFocusTimeout = setTimeout(onAlphaFocusTimeout, 600); + alphaFocusTimeout = setTimeout(onAlphaFocusTimeout.bind(null, this), 600); } }