Skip to content

Commit

Permalink
Add resize to split editor
Browse files Browse the repository at this point in the history
  • Loading branch information
securingsincity committed May 27, 2017
1 parent 6d804af commit 986bd70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/split.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default class SplitComponent extends Component {
if (nextProps.focus && !oldProps.focus) {
this.splitEditor.focus();
}
if(nextProps.height !== this.props.height){
if(nextProps.height !== this.props.height || nextProps.width !== this.props.width){
this.editor.resize();
}
}
Expand Down
2 changes: 2 additions & 0 deletions tests/src/split.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ describe('Split Component', () => {
showPrintMargin={true}
showGutter={false}
height="100px"
width="200px"
/>), mountOptions);

// Read set value
Expand All @@ -299,6 +300,7 @@ describe('Split Component', () => {
showPrintMargin: false,
showGutter: true,
height: '120px',
width: '220px',
});
const newMode = wrapper.first('SplitEditor').props()
expect(oldMode).to.not.deep.equal(newMode);
Expand Down

0 comments on commit 986bd70

Please sign in to comment.