Bug 1554590 - Select first item in alarm dialog. r=philipp
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 10 Jun 2019 21:55:21 +1200
changeset 35822 f6d100d63838d747a56735854aecb78cc415acda
parent 35821 c3a368a1bca2bcb20c7f92cfe5c82ea1d159bc96
child 35823 92831637a3fa267d7df0b98c8604b78b6872efc2
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
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();
 }
 
 /**