diff --git a/client/src/app/App.js b/client/src/app/App.js index 4b2704b0c..78bb497f6 100644 --- a/client/src/app/App.js +++ b/client/src/app/App.js @@ -931,6 +931,9 @@ export class App extends PureComponent { this.updateMenu(tabState); } + if (layout !== prevState.layout) { + this.triggerAction('resize'); + } } componentDidCatch(error, info) { diff --git a/client/src/app/__tests__/AppSpec.js b/client/src/app/__tests__/AppSpec.js index 4f61eb1f7..3f623d8af 100644 --- a/client/src/app/__tests__/AppSpec.js +++ b/client/src/app/__tests__/AppSpec.js @@ -2194,12 +2194,12 @@ describe('', function() { }); - describe('window resize', function() { + describe('resize', function() { afterEach(sinon.restore); - it('should notify tab about window resize', async function() { + it('should trigger tab resize when window is resized', async function() { // given const { app, @@ -2218,6 +2218,31 @@ describe('', function() { tree.unmount(); }); + + it('should trigger tab resize when layout changes', async function() { + // given + const { + app, + tree + } = createApp({}, mount); + + const resizeTabStub = sinon.stub(app, 'resizeTab').resolves(); + + // when + app.setLayout({ + log: { + open: true, + height: 100 + } + }); + + // then + expect(resizeTabStub).to.be.calledOnce; + + // clean + tree.unmount(); + }); + });