Skip to content

JQMIGRATE: jQuery.fn.focus() event shorthand is deprecated #34

@siliconforks

Description

@siliconforks

If you define SCRIPT_DEBUG as TRUE and then click the search icon, the following warning gets displayed in the browser console:

JQMIGRATE: jQuery.fn.focus() event shorthand is deprecated

This is coming from assets/js/full-screen-search.js

There are a couple of ways this could be fixed:

  1. The simplest thing to do would be to just follow the advice at https://api.jquery.com/focus-shorthand/ and make this change:

    Instead of .focus(), use .trigger( "focus" ).

  2. Another possibility would be to use the native focus() method instead. In fact, it might be worthwhile to consider removing jQuery entirely, since that would improve performance. (Actually, in practice it would probably not improve performance much, but it would improve HoverCraft's Google PageSpeed score, and for most people that is all that matters in life.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions