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

Close method calls deprecated $.fn.blur() #1776

Closed
4 of 5 tasks
mikevaux opened this issue Mar 17, 2022 · 4 comments
Closed
4 of 5 tasks

Close method calls deprecated $.fn.blur() #1776

mikevaux opened this issue Mar 17, 2022 · 4 comments
Labels
pending review This issue was closed as stale; since then additional review has been requested.

Comments

@mikevaux
Copy link

I did:

  • Search for if my issue has already been submitted
  • Make sure I'm reporting something precise that needs to be fixed
  • 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)
  • 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:

  1. Click selectize element to open the items dropdown.
  2. Click an item to select it.
  3. 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! :-)

@mikevaux
Copy link
Author

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...

@github-actions
Copy link
Contributor

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

@risadams risadams added pending review This issue was closed as stale; since then additional review has been requested. and removed no-issue-activity labels Jul 16, 2022
@fabienwnklr
Copy link
Contributor

Maybe this issue is not pressing ? long thermal jquery will be completely removed..

@mikevaux
Copy link
Author

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! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending review This issue was closed as stale; since then additional review has been requested.
Projects
None yet
Development

No branches or pull requests

3 participants