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.

FormSelect onChange

See original GitHub issue

In the FormSelect, when invoking the handleChange event, its passing the e.target.value instead of the event itself.

handleChange: function handleChange(e) {
		this._lastChangeValue = e.target.value;
		if (this.props.onChange) this.props.onChange(e.target.value);
	}

Wouldn’t it better to just pass the entire event?

handleChange: function handleChange(e) {
		this._lastChangeValue = e.target.value;
		if (this.props.onChange) this.props.onChange(e);
	}

Thanks.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
jossmaccommented, Dec 17, 2016

@IvanJov agreed, this will break any app using the FormSelect component.

@JedWatson @mxstbr Would need a major version bump – might be a good opportunity to make some other breaking changes.

3reactions
mroswaldcommented, Dec 12, 2016

I ran into the same issue, would be better imo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript onChange for Form Select Field - Stack Overflow
First: "onChange" -> "onchange". Next, wrap the alert function in a wrapper, otherwise ...
Read more >
react-hook-form-select-onchange - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >
onchange Event - W3Schools
The onchange event occurs when the value of an element has been changed. For radiobuttons and checkboxes, the onchange event occurs when the...
Read more >
Javascript onchange Event Tutorial to Get Dropdown Value of ...
Javascript onchange Event Tutorial to Get Dropdown Value of ... Javascript Form Select Change Options Tutorial Dynamic List Elements HTML5.
Read more >
FormSelect | Documentation - frontile.dev
Arg Type Required options any | PromiseProxy Yes selected any Yes beforeOptionsComponent string ‑
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