Bug 1544065 - fix clicking on <span> tags inside voice selector in reader mode, r=eeejay
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 15 Apr 2019 16:34:28 +0000
changeset 469539 8ea3101cfbad67458ee23e560ce4c873e129d307
parent 469538 127dba490969122ab2c7523bc98db6f739d95f0a
child 469540 f057b78337e7442427b3379537c67d5761f2bf39
push id112801
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:40:09 +0000
treeherdermozilla-inbound@afb20612c0e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1544065
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1544065 - fix clicking on <span> tags inside voice selector in reader mode, r=eeejay Differential Revision: https://phabricator.services.mozilla.com/D27510
toolkit/components/narrate/VoiceSelect.jsm
--- a/toolkit/components/narrate/VoiceSelect.jsm
+++ b/toolkit/components/narrate/VoiceSelect.jsm
@@ -83,16 +83,17 @@ VoiceSelect.prototype = {
     }
   },
 
   handleEvent(evt) {
     let target = evt.target;
 
     switch (evt.type) {
       case "click":
+        target = target.closest(".option, .select-toggle") || target;
         if (target.classList.contains("option")) {
           if (!target.classList.contains("selected")) {
             this.selected = target;
           }
 
           this.toggleList(false);
         } else if (target.classList.contains("select-toggle")) {
           this.toggleList();