hovercraft icon indicating copy to clipboard operation
hovercraft copied to clipboard

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

Open siliconforks opened this issue 2 years ago • 0 comments

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

siliconforks avatar Nov 18 '23 19:11 siliconforks