Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to handle Chrome 13.x Autofills with React's <input> onChange #1

Open
smishr4 opened this issue Jan 1, 2018 · 1 comment
Open

Comments

@smishr4
Copy link

smishr4 commented Jan 1, 2018

Figured out just recently that its existing issue in React. See React DOM Bugs

There I saw JackieLs's suggestion to do it using the following polyfill:

<input ref={n => this.input = n} id={field} name={name || field} type={ type || 'text' } defaultValue={ value } autoComplete={ autofill } maxLength={maxLength} />

and

  `componentDidMount(){
	this.input.addEventListener('change', (e)=>{
		this.props.onChange(this.props.field, e.target.value)
	})
   }`

**remember to remove eventListner on component unmount.

@smishr4 smishr4 self-assigned this Jan 1, 2018
@smishr4
Copy link
Author

smishr4 commented Jan 1, 2018

#facebook/react#1159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant