Skip to content

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

Closed
@mikevaux

Description

@mikevaux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending reviewThis issue was closed as stale; since then additional review has been requested.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions