Bug 1544065 - fix clicking on <span> tags inside voice selector in reader mode, r=eeejay a=pascalc
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 15 Apr 2019 16:34:28 +0000
changeset 526215 78d63ea6abba287bb83cd68d376d12c08bea4ad3
parent 526214 ef4d0e2f5ebc75f4023e1c2a7e2b7b82211e86dd
child 526216 54e5eaa7cd9cb2f1be19dceee121f9e1832598c9
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay, pascalc
bugs1544065
milestone67.0
Bug 1544065 - fix clicking on <span> tags inside voice selector in reader mode, r=eeejay a=pascalc 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();