Bug 1554590 - Select first item in alarm dialog. r=philipp
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 10 Jun 2019 21:55:21 +1200
changeset 26859 f6d100d63838d747a56735854aecb78cc415acda
parent 26858 c3a368a1bca2bcb20c7f92cfe5c82ea1d159bc96
child 26860 92831637a3fa267d7df0b98c8604b78b6872efc2
push id16031
push usermozilla@jorgk.com
push dateTue, 11 Jun 2019 08:38:58 +0000
treeherdercomm-central@75267aa625a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs1554590
Bug 1554590 - Select first item in alarm dialog. r=philipp
calendar/base/content/dialogs/calendar-alarm-dialog.js
--- a/calendar/base/content/dialogs/calendar-alarm-dialog.js
+++ b/calendar/base/content/dialogs/calendar-alarm-dialog.js
@@ -307,17 +307,17 @@ function addWidgetFor(aItem, aAlarm) {
     setupTitle();
     doReadOnlyChecks();
 
     if (!alarmRichlist.userSelectedWidget) {
         // Always select first widget of the list.
         // Since the onselect event causes scrolling,
         // we don't want to process the event when adding widgets.
         alarmRichlist.suppressOnSelect = true;
-        alarmRichlist.selectedIndex = 0;
+        alarmRichlist.selectedItem = alarmRichlist.firstElementChild;
         alarmRichlist.suppressOnSelect = false;
     }
 
     window.focus();
     window.getAttention();
 }
 
 /**