I'm seeing this behaviour with a file input element and setting a variable:
- On the input event, I log to console: event -> target -> get(files) -> get([0])
- I then set the variable to exactly the same: event -> target -> get(files) -> get([0])
- I then log the variable to the console
On the first input, the event data is as expected and the variable is set to the event data
On the second input, the event data is as expected (the new file) but the variable is not updated.
The only way I can work around this is to set the variable to nul before assigning it the event data. Not sure if I'm using the correct event (input)?
I'm attaching a screenshot of the console log, and I have a little demo project that demonstrates the behaviour if anyone wants to take a look.
Thanks!