Ember.js V5 - Jquery Event

This automation removes all calls to originalEvent in case of accessing properties that work with jQuery events as well as native events.

Estimated time saving
5 minutes/occurrence
Change mode
Applicability criteria

Ember.js version higher or equal to 3.3.

Made by
Rajasegar Chandran
Rajasegar Chandran

Usage →

Codemod CLI:

intuita ember/5/jquery-event
copy CLI command icon

Codemod VS Code extension:

vs code logo
Run in VS Code

Use/edit codemod in Codemod Studio:

intuita logo without text
Open in Codemod Studio

Description

Using event object APIs that are specific to jQuery.Event, such as originalEvent, is deprecated in Ember.js v3.3. This codemod removes all calls to originalEvent in case of accessing properties that work with jQuery events as well as native events.

Example

Before:

// your event handler:
export default Component.extend({
	click(event) {
		let x = event.originalEvent.clientX;
	},
});

After:

// your event handler:
export default Component.extend({
	click(event) {
		let x = event.clientX;
	},
});