Skip to content
Open
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
6 changes: 6 additions & 0 deletions dist/js/bootstrap-multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@
selectAllJustVisible: true,
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
enableAccentInsensitiveFiltering: false,
enableFullValueFiltering: false,
enableClickableOptGroups: false,
enableCollapsibleOptGroups: false,
Expand Down Expand Up @@ -1260,6 +1261,11 @@
this.query = this.query.toLowerCase();
}

if (this.options.enableAccentInsensitiveFiltering) {
filterCandidate = filterCandidate.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
this.query = this.query.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}

if (this.options.enableFullValueFiltering && this.options.filterBehavior !== 'both') {
var valueToMatch = filterCandidate.trim().substring(0, this.query.length);
if (this.query.indexOf(valueToMatch) > -1) {
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap-multiselect/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ interface MultiSelectOptions {
*/
enableCaseInsensitiveFiltering?: boolean;

/**
* The filter as configured above will use accent sensitive filtering,
* by setting enableAccentInsensitiveFiltering to true this behavior can be changed to use accent insensitive filtering.
*/
enableAccentInsensitiveFiltering?: boolean;

/**
* Set to true to enable full value filtering, that is all options are shown where the query is a prefix of.
*/
Expand Down