React-ace: height doesn't update

Created on 11 Jan 2017  路  2Comments  路  Source: securingsincity/react-ace

Is there anyway to update the height of the react editor programmatically? I am listening for a window resize event, and I pass in the correct height, but the ace editor height does not adjust, even when it's passed in a different height.

I also tried getting the reference to the editor and using editor.resize(), but even that doesn't work.

Most helpful comment

For benefit of others with this issue, say your component is <AceEditor ... ref="reactAceEditor" />, you have to do this.refs.reactAceEditor.editor.resize() to update height

All 2 comments

Nevermind, got it to work...turns out, I wasn't updating the component

For benefit of others with this issue, say your component is <AceEditor ... ref="reactAceEditor" />, you have to do this.refs.reactAceEditor.editor.resize() to update height

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenBrewerBowman picture BenBrewerBowman  路  5Comments

Lyeed picture Lyeed  路  3Comments

huangjiatian picture huangjiatian  路  7Comments

ponelat picture ponelat  路  3Comments

Bobcui001 picture Bobcui001  路  5Comments