selectize.js
selectize.js copied to clipboard
Close method calls deprecated `$.fn.blur()`
I did:
- [x] Search for if my issue has already been submitted
- [x] Make sure I'm reporting something precise that needs to be fixed
- [x] Give my issue a descriptive and concise title
- [ ] Create a minimal working example on JsFiddle or Codepen (or gave a link to a demo on the Selectize docs)
- [x] Indicate precise steps to reproduce in numbers and the result, like below
The close method calls the deprecated $.fn.blur() shorthand:
if (self.isBlurring) {
self.$control_input.blur(); // close keyboard on iOS
}
This triggers a warning when running jQuery Migrate.
Steps to reproduce:
- Click selectize element to open the items dropdown.
- Click an item to select it.
- Click out of the selectize control
Expected result: No deprecation warning
Actual result: Deprecation warning
Further Details:
I think #1625 referenced this, but the PR which closed that issue (#1624) only actually addressed $.fn.trim(), not $.fn.blur().
I wonder if this could be as simple as updating as follows, but I'm not confident in it:
if (self.isBlurring) {
- self.$control_input.blur(); // close keyboard on iOS
+ self.$control_input[0].blur(); // close keyboard on iOS
}
Happy to create a PR if it is thought that this is the way to go! :-)
Or
if (self.isBlurring) {
- self.$control_input.blur(); // close keyboard on iOS
+ self.$control_input.trigger('blur'); // close keyboard on iOS
}
if that is preferable...
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days
Maybe this issue is not pressing ? long thermal jquery will be completely removed..
I agree that it's not pressing, though I think probably work a fix when someone gets time, especially as it's presumably a simple fix (see my suggestions above). If the jQuery team release e.g. a version 4.0 which drops support altogether, this could well break the whole script.
I also agree that jQuery is becoming less of a requirement for a lot of projects, but I think it's very unlikely that this whole library will be rewritten without jQuery as a dependency any time soon, so I think unless there is a clear roadmap for that, we shouldn't assume that jQuery will be dropped here.
Happy to be disagreed with! :)