Skip to content

Commit

Permalink
fix(groups): prevent occational UI jump when updating module order (#872
Browse files Browse the repository at this point in the history
)
  • Loading branch information
2xAA authored Jun 21, 2023
1 parent e12bbe5 commit 00cd620
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/Group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
@drop="onDrop"
>
<Draggable
v-for="moduleId in modules"
v-for="moduleId in localModules"
:key="moduleId"
class="group__module"
>
Expand Down Expand Up @@ -284,12 +284,14 @@ export default {
controlsShown: false,
Arrow,
inheritanceSelection: -1,
grabbing: false
grabbing: false,
localModules: []
};
},
created() {
this.localName = this.name;
this.localModules = this.modules;
this.inheritanceSelection = !this.inherit ? -2 : this.inheritFrom;
if (!this.focusedGroup) {
Expand Down Expand Up @@ -321,6 +323,9 @@ export default {
},
set(modules) {
// localModules is used to avoid a UI jump as we wait for the worker to
// send back the updated order
this.localModules = modules;
this.$modV.store.commit("groups/REPLACE_GROUP_MODULES", {
groupId: this.groupId,
modules
Expand Down Expand Up @@ -569,6 +574,10 @@ export default {
this.localName = value;
},
modules(value) {
this.localModules = value;
},
inheritanceSelection(value) {
const inheritFrom = value.length === 2 ? parseInt(value) : value;
Expand Down

0 comments on commit 00cd620

Please sign in to comment.