diff --git a/README.md b/README.md index c0fc56142..e151040ee 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,7 @@ E.g., if it was used in a menu and the menu is red, the circle would be red. * (foxriver76) fixed last change y-offset for some widgets * (foxriver76) fixed issue where JquiState did not respect data type * (foxriver76) fixed issues with BulkEdtior (dialog not closing and other dialog showing wrong button) +* (foxriver76) implemented workaround resize bug for https://github.com/devbookhq/splitter/issues/15 ### 2.9.13 (2024-01-08) * (foxriver76) correctly detect IDs in bindings when they contain hash character diff --git a/src/src/App.jsx b/src/src/App.jsx index 59b5cd4bd..58980d18c 100644 --- a/src/src/App.jsx +++ b/src/src/App.jsx @@ -1965,8 +1965,16 @@ class App extends Runtime { } else { splitSizes = newSizes; } - this.setState({ splitSizes }); - window.localStorage.setItem('Vis.splitSizes', JSON.stringify(splitSizes)); + + const sum = splitSizes.reduce((prev, curr) => prev + curr); + if (Math.ceil(sum) !== 100) { + // https://github.com/devbookhq/splitter/issues/15 + console.log('Decline resize, to work around bug in @devbookhq/splitter'); + this.setState({ splitSizes: this.state.splitSizes }); + } else { + this.setState({ splitSizes }); + window.localStorage.setItem('Vis.splitSizes', JSON.stringify(splitSizes)); + } }} theme={this.state.themeName === 'dark' ? GutterTheme.Dark : GutterTheme.Light} gutterClassName={this.state.themeName === 'dark' ? 'Dark visGutter' : 'Light visGutter'}