From 2df72b20852f3c9719940d56328ea472884f9e53 Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sun, 1 Jan 2017 13:57:23 -0800 Subject: [PATCH] fix #1220 If editor was focused, a click is preceded by blur which selection.js listens to which updates range to null. This SELECTION_CHANGE is listened to by themes to update their pickers which will result in the wrong expanded state. --- ui/picker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/picker.js b/ui/picker.js index 52cd2f00a6..63e0214031 100644 --- a/ui/picker.js +++ b/ui/picker.js @@ -8,7 +8,7 @@ class Picker { this.buildPicker(); this.select.style.display = 'none'; this.select.parentNode.insertBefore(this.container, this.select); - this.label.addEventListener('click', () => { + this.label.addEventListener('mousedown', () => { this.container.classList.toggle('ql-expanded'); }); this.select.addEventListener('change', this.update.bind(this));