- // If used inside HTML form, then create hidden input, which will store
- // the results.
- this.hiddenInput = $( '<input>' )
- .attr( 'type', 'hidden' )
+ // Use this instead of <input type="hidden">, because hidden inputs do not have separate
+ // 'value' and 'defaultValue' properties. The script on Special:Preferences
+ // (mw.special.preferences.confirmClose) checks this property to see if a field was changed.
+ this.hiddenInput = $( '<textarea>' )
+ .addClass( 'oo-ui-element-hidden' )