# Aurelia 2.0.0-beta.1 event handling changes

**URL:** <https://discourse.aurelia.io/t/aurelia-2-0-0-beta-1-event-handling-changes/5058>\
**Category:** vNext\
**Created:** [January 20, 2023, 12:06am UTC](https://discourse.aurelia.io/t/aurelia-2-0-0-beta-1-event-handling-changes/5058 "2023-01-20T00:06:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Node0](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/node0/32/2391_2.png) [@Node0](https://discourse.aurelia.io/u/Node0)\
**Post date:** [January 20, 2023, 12:06am UTC](https://discourse.aurelia.io/t/aurelia-2-0-0-beta-1-event-handling-changes/5058/1 "2023-01-20T00:06:01Z")

</div>

## Aurelia 2.0.0-beta.1 updates for event linkage in templates and handling in view-models (TS/JS)

_Like many of you, I immediately updated when I heard the news come out regarding 2.0.0-beta.1, and it’s an overall win in many places, I did run into some issues with events (in template and view-models) so I’m posting my findings here for anyone who is in the same situation. Please feel free to add to this thread so that we can cover more event behavior changes for the benefit of the community._

### Important changes:

The **`<eventName>.delegate="myHandler()"`** construct has been removed entirely from the framework.  
The **`<eventName>.trigger="myHandler()"`** construct takes its place.  
( `<eventName>.capture="myHandler()"` is still there as well for same uses as before).

### Changes to $event object (in templates or view-models):

When accessing the $event object, please note:

- `$event.path[]` is apparently no longer in use (possibly removed in an effort to get rid of the browser warnings (good call, but it means us developers might need to refactor a bit).

- `$event.target` is the new consolidated way to access event values, for example:

- For simple things like text fields:

- Focus (and blur) seem to work like input:

(despite the bubbling differences, great job Aurelia team for homogenizing the experience!)

So to recap, if upgrading to Aurelia 2.0.0-beta.1, refactor to get rid of `<eventName>.delegate="myHandler($event)"` to replace with `<eventName>.trigger="myHandler($event)"` AND in the handler methods replace `event.path[]...` with `event.target.value` or for more complex data structures, `event.target.selectedOptions[0]`

I hope this helps some confused people!
