Skip to content

Commit ed58b7f

Browse files
authored
feat(dropdown): change forceSelection default to false
This PR changes default value for forceSelection to false, because if you click into a dropdownfield and click outside again, the first dropdown value will be selected automatically which is probably not wanted in most cases so it shouldn't be the default. If a select HTML field to be converted into a FUI dropdownfield got a required attribute, the forceSelection setting will be set to true again automatically As this is a breaking change it is supposed to be part of 2.9
1 parent 2ecf719 commit ed58b7f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/definitions/modules/dropdown.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ $.fn.dropdown = function(parameters) {
422422
module.debug('Disabling dropdown');
423423
$module.addClass(className.disabled);
424424
}
425+
if($input.is('[required]')) {
426+
settings.forceSelection = true;
427+
}
425428
$input
426429
.removeAttr('required')
427430
.removeAttr('class')
@@ -3991,7 +3994,7 @@ $.fn.dropdown.settings = {
39913994
preserveHTML : true, // preserve html when selecting value
39923995
sortSelect : false, // sort selection on init
39933996

3994-
forceSelection : true, // force a choice on blur with search selection
3997+
forceSelection : false, // force a choice on blur with search selection
39953998

39963999
allowAdditions : false, // whether multiple select should allow user added values
39974000
ignoreCase : false, // whether to consider case sensitivity when creating labels

0 commit comments

Comments
 (0)