Skip to content

Commit

Permalink
fix: incorrect priority set in personalization script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu committed Sep 12, 2023
1 parent de8f711 commit e70f7b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions assets/controllers/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class extends Controller {
}

#onPriorityChange(event) {
const priorityInputs = this.#getPriorityInputs(event.from);
const priorityInputs = this.#getPriorityInputs(event.to);

const changes = {};

Expand Down Expand Up @@ -68,7 +68,10 @@ export default class extends Controller {
return new Sortable(target, {
group: 'shared',
animation: 150,
onAdd: this.#onVisibilityChange.bind(this),
onAdd: (event) => {
this.#onVisibilityChange(event);
this.#onPriorityChange(event);
},
onChange: this.#onPriorityChange.bind(this),
})
}
Expand Down

0 comments on commit e70f7b6

Please sign in to comment.