-
Notifications
You must be signed in to change notification settings - Fork 586
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
Letters are being deleted whilst typing fast in IE #350
Comments
Duplicate of #211. |
Thanks @moroshko , good to know. Not able to try React 16.0.0-alpha.6 in short notice as we have complicated dependencies. Will post the result later. |
@moroshko This is a significant bug that makes this component not ready for production. How much longer before ReactJS 16.0 is released? |
I'm sorry for that, but there is not much we can do, I guess.
React 16.0.0-alpha.12 is on npm. You are welcome to try it and report back if it solves the issue ;) |
Have been looking at this issue some evenings, and something special happens in IE11 when we in the onChange-event both calls props.inputProps.onChange and props.onSuggestionsFetchRequested. Looks like new suggestions are interfering with the onChange event, because if you comment that out it works fine. So we fixed this by delaying our async fetching of suggestion in 500ms, to ensure that the user has paused typing before new suggestions are sent into the Autosuggest-component: onSuggestionsFetchRequested = ({value}) => {
const {fetchSuggestions, suggestionsLoading} = this.props
const escapedValue = escapeRegexCharacters(value.trim())
if (!suggestionsLoading && escapedValue.length >= 3) {
if (this.fetchSuggestionsTimeout) {
window.clearTimeout(this.fetchSuggestionsTimeout)
this.fetchSuggestionsTimeout = undefined
}
this.fetchSuggestionsTimeout = setTimeout(() => {
fetchSuggestions(escapedValue)
}, 500)
}
} |
@moroshko Awesome!!! Can you update the CDN version so I can link to it? |
@gerhardsletten 's fix might look like working for a while but it is such a temporary work around, since no one can guarantee the user won't type again after 500ms. @moroshko React 16.0.0-alpha.6 hasn't included the fix and I reckon the AutoSuggest component should address this issue in React 15. |
@ElliotZhang yes, its true. We ended up disable the autosuggest for ie-users, waiting for react 16 to ship. I think it can't be fixed for IE in react 15 |
@gerhardsletten , I've tried replacing the onChange to onInput in Autosuggest component and it looks working well. Just one line of change. But will break IE9 and IE10 though, see facebook/react#7027 |
@ElliotZhang Yes, been there, done that. As I said, I have given up on this error. Think the best solution would be to short circuit react events and hooking into the dom-event yourself, but I don't want to go there ;-) |
@moroshko @ElliotZhang @gerhardsletten @jarib @zachhale This issue has been fixed in React JS. I have only tested the latest version of React (15.6.1), so I don't know what version it was fixed in. You can close this issue. |
This should be a bug and can be reproduced in the example codepen http://codepen.io/moroshko/pen/ZQLyNK
To reproduce:
I've tried it in my local with console logging debug and it shows the onChange() method is only fired once for multiple inputs and receiving an outdated value.
Any idea about this?
The text was updated successfully, but these errors were encountered: