Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dropdown): collapse on clearable optional #3115

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,9 @@
if (module.is.searchSelection()) {
module.remove.searchTerm();
}
module.hide();
if (settings.collapseOnClearable) {
module.hide();
}
event.stopPropagation();
},
},
Expand Down Expand Up @@ -4096,6 +4098,7 @@
headerDivider: true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>

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

// label settings on multi-select
label: {
Expand Down
6 changes: 6 additions & 0 deletions types/fomantic-ui-dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@ declare namespace FomanticUI {
*/
collapseOnActionable: boolean;

/**
* Whether the dropdown should collapse upon clicking the clearable icon.
* @default false
*/
collapseOnClearable: boolean;

/**
* Allows customization of multi-select labels.
* @default true
Expand Down