Skip to content

Commit 14bf847

Browse files
authored
feat(dropdown): collapse on clearable optional
Added an option collapseOnClearable to collapse the dropdown upon clicking on the clearable icon SUI does not collapse, but FUI does, so i made this option false by default so the behavior matches SUI.
1 parent f3182cf commit 14bf847

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/definitions/modules/dropdown.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,9 @@
12301230
if (module.is.searchSelection()) {
12311231
module.remove.searchTerm();
12321232
}
1233-
module.hide();
1233+
if (settings.collapseOnClearable) {
1234+
module.hide();
1235+
}
12341236
event.stopPropagation();
12351237
},
12361238
},
@@ -4096,6 +4098,7 @@
40964098
headerDivider: true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
40974099

40984100
collapseOnActionable: true, // whether the dropdown should collapse upon selection of an actionable item
4101+
collapseOnClearable: false, // whether the dropdown should collapse upon clicking the clearable icon
40994102

41004103
// label settings on multi-select
41014104
label: {

types/fomantic-ui-dropdown.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,12 @@ declare namespace FomanticUI {
480480
*/
481481
collapseOnActionable: boolean;
482482

483+
/**
484+
* Whether the dropdown should collapse upon clicking the clearable icon.
485+
* @default false
486+
*/
487+
collapseOnClearable: boolean;
488+
483489
/**
484490
* Allows customization of multi-select labels.
485491
* @default true

0 commit comments

Comments
 (0)