Skip to content

Commit

Permalink
implemented workaround resize bug for devbookhq/splitter#15
Browse files Browse the repository at this point in the history
- closes #282
  • Loading branch information
foxriver76 committed Jan 9, 2024
1 parent 8d19702 commit 4db6d45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions src/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down

0 comments on commit 4db6d45

Please sign in to comment.