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

Compatible with autocomplete source function #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jordi-pujol-cayon
Copy link

Call accentFolding.fold at $.ui.autocomplete.filter() and leaving autocomplete.source as original.
Works with the three types of source: array of values, function or url-string.
Tested with "multiple" jquery-ui autocomplete example. https://jqueryui.com/autocomplete/#multiple

Call accentFolding.fold at $.ui.autocomplete.filter() and leaving autocomplete.source as original.
Works with the three types of source: array of values, function or url-string.
Tested with "multiple" jquery-ui autocomplete example. https://jqueryui.com/autocomplete/#multiple
@scottgonzalez
Copy link
Owner

What are you trying to accomplish with this change?

@jordi-pujol-cayon
Copy link
Author

With this change the extension does the same than before but extends the usage to source function calls.

I want a multiple selection box as seen in autocomplete example [https://jqueryui.com/autocomplete/#multiple] The autocomplete source must be defined at initialization as a function but the current accentFolding extension does not work because of the isArray check.
So I have moved the accentFolding.fold call outside of the source function and redefine $.ui.autocomplete.filter; now does folding at every filter search.

Of course I can mix the multiple example with folding example in a new source function and ignoring the extension, but doing this he source function definition becomes a matter for every autocomplete instance.

@scottgonzalez
Copy link
Owner

$.ui.autocomplete.filter is only used for array sources, so how is this possibly doing what you want?

@scottgonzalez
Copy link
Owner

Oh, I see, because the remote example is using the filter directly.

@scottgonzalez
Copy link
Owner

Can you clean up the code to actually follow the existing style and indentation?

@jordi-pujol-cayon
Copy link
Author

Done. Forgot to answer.

@vendethiel
Copy link

@scottgonzalez ?

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

Successfully merging this pull request may close these issues.

3 participants