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

Set defaults recursively #4887

Closed
wants to merge 1 commit into from
Closed

Set defaults recursively #4887

wants to merge 1 commit into from

Conversation

semenyukdmitry
Copy link

Without the patch, when you set defaults like this:

$.fn.select2.defaults.set("ajax--delay", 250)
$.fn.select2.defaults.set("ajax--minimumResultsForSearch", 2)

you get defaults == ajax: { minimumResultsForSearch: 2 } (delay is dismissed).

This pull request includes a

  • Bug fix
  • New feature
  • Translation

The following changes were made

  • Set default options recursively (so that you can set ajax defaults)

Make calls like this work:
$.fn.select2.defaults.set("ajax--delay", 250)
$.fn.select2.defaults.set("ajax--minimumResultsForSearch", 2)
@alexweissman
Copy link
Contributor

I'm not quite convinced that this is a bug. Isn't set supposed to override, rather than extend?

@alexweissman
Copy link
Contributor

Actually, this is a duplicate of #4364, except that #4364 also includes some additional tests.

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

Successfully merging this pull request may close these issues.

None yet

2 participants