Skip to content

Commit

Permalink
Merge pull request #241 from dmigo/master
Browse files Browse the repository at this point in the history
Fix sizing issues
  • Loading branch information
securingsincity authored Aug 3, 2017
2 parents c3a7bc5 + 5e3feb8 commit ceec5aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export default class ReactAce extends Component {
if (onLoad) {
onLoad(this.editor);
}

this.editor.resize();
}

componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -174,7 +176,10 @@ export default class ReactAce extends Component {
if (nextProps.focus && !oldProps.focus) {
this.editor.focus();
}
if(nextProps.height !== this.props.height || nextProps.width !== this.props.width){
}

componentDidUpdate(prevProps) {
if(prevProps.height !== this.props.height || prevProps.width !== this.props.width){
this.editor.resize();
}
}
Expand Down

0 comments on commit ceec5aa

Please sign in to comment.