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

search with accents #1252

Open
leandroBarbosaFR opened this issue Feb 6, 2023 · 1 comment
Open

search with accents #1252

leandroBarbosaFR opened this issue Feb 6, 2023 · 1 comment

Comments

@leandroBarbosaFR
Copy link

Hello everybody, When I search and don't put accents, my search doesn't work, how do I turn off the accents?

@mr-rayhaan
Copy link

mr-rayhaan commented May 21, 2024

I fixed it by editing the bootstrap_multiselect.js file. I use the normalize function to replace the search query and also the select options

Original:

if (this.query !== event.target.value) {
this.query = event.target.value;

var currentGroup, currentGroupVisible;
$.each($('.multiselect-item', this.$ul), $.proxy(function(index, element) {
var value = $('input', element).length > 0 ? $('input', element).val() : "";
var text = $('label', element).text();

Fixed:

if (this.query !== event.target.value) {
this.query = event.target.value.normalize('NFD').replace(/[\u0300-\u036f]/g, "");

var currentGroup, currentGroupVisible;
$.each($('.multiselect-item', this.$ul), $.proxy(function(index, element) {
var value = $('input', element).length > 0 ? $('input', element).val() : "";
var text = $('label', element).text().normalize('NFD').replace(/[\u0300-\u036f]/g, "");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants