click() shorthand is deprecated at jQuery 3
@see https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigra...

The .on() and .trigger() methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu.

CommentFileSizeAuthor
#4 3187940-4.patch29.8 KBjrockowitz

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Issue summary: View changes
jrockowitz’s picture

Here are the replacement patterns

Trigger replacement pattern

Find: \.(click|blur|focus|focusin|focusout|resize|scroll|dblclick|mousedown|mouseup|mousemove|mouseover|mouseout|mouseenter|mouseleave|change|select|submit|keydown|keypress|keyup\contextmenu)\(\)

Replace: .trigger\('$1'\)

Handler replacement pattern

Find: \.(click|blur|focus|focusin|focusout|resize|scroll|dblclick|mousedown|mouseup|mousemove|mouseover|mouseout|mouseenter|mouseleave|change|select|submit|keydown|keypress|keyup\contextmenu)\(

Replace: .on\('$1',

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new29.8 KB
jrockowitz’s picture

Status: Needs review » Fixed

The fact that the patch is pretty much only two find-n-replaces and there some JavaScript test coverage makes me comfortable committing it.

If anyone runs into issues, please reopen this ticket and we can revert the patch.

  • jrockowitz authored d187262 on 8.x-5.x
    Issue #3187940 by jrockowitz: click() shorthand is deprecated at jQuery...

  • jrockowitz authored d187262 on 6.x
    Issue #3187940 by jrockowitz: click() shorthand is deprecated at jQuery...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.