Skip to content

Commit

Permalink
after creating a group it is now pre-selected (#220)
Browse files Browse the repository at this point in the history
- closes #211

Signed-off-by: Max Hauser <[email protected]>
  • Loading branch information
foxriver76 authored Nov 29, 2023
1 parent d601f86 commit 9e1a767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ E.g., if it was used in a menu and the menu is red, the circle would be red.
## Changelog
### **WORK IN PROGRESS**
* (foxriver76) fixed reactivity in custom components
* (foxriver76) after creating a group it is now pre-selected
* (foxriver76) fields are now updated when moved via keyboard
* (foxriver76) fixed import for groups

### 2.9.1 (2023-11-28)
* (foxriver76) recalculate fields after moving widgets
Expand Down
9 changes: 5 additions & 4 deletions src/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,8 @@ class App extends Runtime {
return null;
}

groupWidgets = () => {
const project = JSON.parse(JSON.stringify(store.getState().visProject));
groupWidgets = async () => {
const project = deepClone(store.getState().visProject);
const widgets = project[this.state.selectedView].widgets;
const group = {
tpl: '_tplGroup',
Expand Down Expand Up @@ -885,7 +885,8 @@ class App extends Runtime {
group.style.height = `${bottom - top}px`;
widgets[groupId] = group;

return this.changeProject(project);
await this.changeProject(project);
this.setSelectedWidgets([groupId]);
};

ungroupWidgets = () => {
Expand Down Expand Up @@ -957,7 +958,7 @@ class App extends Runtime {
}, 1000);
}

changeProject = async (project, ignoreHistory) => {
changeProject = async (project, ignoreHistory = false) => {
// set timestamp
project.___settings.ts = `${Date.now()}.${Math.random().toString(36).substring(7)}`;

Expand Down

0 comments on commit 9e1a767

Please sign in to comment.