This repository was archived by the owner on Mar 1, 2024. It is now read-only.
Conversation
…in `window.getComputedStyle(ta, null);` Update: Autosize to v4
Contributor
Author
|
@FrancescoCioria can you check this out, and maybe push it? 😁 |
Contributor
|
weird, I never had this bug in IE11. are you rendering the textarea inside an |
Contributor
Author
|
Nope, just a normal The weird part is that sometimes worked and sometimes didn't and it all started since we updated to React 16 |
Contributor
|
can we replicate it via a fiddle? I'm not fond of adding a PS: if you're using React16 you could fallback to a plain // AutosizeTextarea.js
import _TextareaAutosize from 'react-autosize-textarea'
export default class TextareaAutosize extends React.Component {
state = {
autosizeCrashed: false
}
componentDidCatch(error, info) {
// Display fallback <textarea>
this.setState({ autosizeCrashed: true });
}
render() {
if (this.state.autosizeCrashed) {
return <textarea {...this.props} />;
}
return <_TextareaAutosize {...this.props} />;
}
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's this weird bug in IE11 and below, if there is a React Component with ReactAutosizeTextarea, the component will no longer trigger componentDidMount because
window.getComputedStyle(ta, null);throws an access denied.Should be fixed in
autosizerepo, but until then, added autosize in a try catch to prevent the error from disrupting the whole applicationAlso updated package.json to autosize v.4 (thought that will fix it), apparently not.