Skip to content

Question - Why do methods like blur, focus, click, etc. generate warnings? #410

Closed
@nestedsoftware

Description

@nestedsoftware

Hi, I am hoping to get some clarification around why the following code is in the migrate plugin. Looking at the upgrade guide, I do not see any mention of any of these methods being deprecated. Likewise, they are nor marked as deprecated in the docs.

jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
	"change select submit keydown keypress keyup contextmenu" ).split( " " ),
	function( _i, name ) {

	// Handle event binding
	jQuery.fn[ name ] = function( data, fn ) {
		migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" );
		return arguments.length > 0 ?
			this.on( name, null, data, fn ) :
			this.trigger( name );
	};
} );

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