question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trigger change event on input field

See original GitHub issue

Hey,

is it possible to trigger an change event on an input field with a given value?

input.simulate('change', 'value') and input.simulate('change', { target: 'value' }) doesn’t work and I don’t find anything in the docs.

Thanks in advance. ✌️

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hauptrollecommented, May 19, 2017

@eddyerburgh Hey, sorry for the late response. It works as expected. 👍 It seems to be an issue in the “vue-material” package I was using …

0reactions
eddyerburghcommented, May 18, 2017

@hauptrolle Have you found a way around this?

If not, could you post the component and test so I can test what’s happening.

I’ve ran some tests, and setting the element value before simulating an event sends event.target.value as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I programmatically force an onchange event on an ...
The change event in an input element is triggered directly only by the user. To trigger the change event programmatically we need to...
Read more >
How can I trigger an onchange event manually in javascript?
You can dispatch events on individual elements using the dispatchEvent method. Let's say you have an element test with an onChange event −...
Read more >
Events: change, input, cut, copy, paste
The change event triggers when the element has finished changing. For text inputs that means that the event occurs when it loses focus....
Read more >
.change() | jQuery API Documentation
Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then...
Read more >
HTMLElement: change event - Web APIs | MDN
Try entering something into the field below, and then click somewhere else to trigger the event. HTML. <input placeholder="Enter some text" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found