[solved] Trouble in testing <input> with manual event trigger

I have trouble to test something simple like this

<input value.bind="message">

Aurelia doc says it will update model on “change” and “input” event. https://aurelia.io/docs/binding/binding-behaviors#updatetrigger

I try to use jQuery to mutate the input, then manually trigger a “change” event. But my model “message” still doesn’t update.

jQuery('input').val('test').trigger('change');

Here is a gistrun to demonstrate my problem. Did I do something wrongly?

I have a feeling that jquery does some internal magic with events which Aurelia can’t detect.

I changed the gist to a functional one by using jquery’s get to return the actual html element and then triggering the event in the native vanilla js way

1 Like

Thank you @Kukks :smile:

You can easily replace all of that jquery code though. Check the gist again, removed all the jquery “crap”. :slight_smile:

1 Like