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 469527 8ea3101cfbad
parent 469526 127dba490969
child 469528 f057b78337e7
push id35873
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:36:26 +0000
treeherdermozilla-central@b8f49a14c458 [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();