File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -625,10 +625,11 @@ $(function() {
625625
626626 // dirty field tracking
627627 $ ( '#changeform select' ) . each ( function ( ) {
628- var that = $ ( this ) ;
629- var dirty = $ ( '#' + that . attr ( 'id' ) + '-dirty' ) ;
628+ const that = $ ( this ) ;
629+ const id = that . attr ( 'id' ) ;
630+ const dirty = $ ( `#${ id } -dirty` ) ;
631+
630632 if ( ! dirty ) return ;
631- var isMultiple = that . attr ( 'multiple' ) ;
632633
633634 // store the option that had the selected attribute when we
634635 // initially loaded
@@ -638,8 +639,8 @@ $(function() {
638639 that . data ( 'preselected' , value ) ;
639640
640641 // if the user hasn't touched a field, override the browser's choice
641- // with Bugzilla's
642- if ( ! dirty . val ( ) )
642+ // with Bugzilla's, unless it's the component field
643+ if ( id !== 'component' && ! dirty . val ( ) )
643644 that . val ( value ) ;
644645 } ) ;
645646
Original file line number Diff line number Diff line change @@ -257,10 +257,6 @@ window.addEventListener('DOMContentLoaded', () => {
257257 if ( $form . component . options . length === 1 ) {
258258 $form . component . selectedIndex = 0 ;
259259 } else {
260- // Select first compponent if more than one and none are selected
261- if ( $form . component . selectedIndex === - 1 ) {
262- $form . component . selectedIndex = 0 ;
263- }
264260 $form . component . addEventListener ( 'change' , ( ) => {
265261 onComponentChange ( ) ;
266262 } ) ;
You can’t perform that action at this time.
0 commit comments