Skip to content

Commit

Permalink
🐛 Fix Shift+Click selection in room-entities-list selecting copies th…
Browse files Browse the repository at this point in the history
…at do not satisfy the current search query
  • Loading branch information
CosmoMyzrailGorynych committed Oct 13, 2024
1 parent 359d559 commit 52e1151
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/riotTags/editors/room-editor/room-entities-list.tag
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,23 @@ room-entities-list(onpointerout="{clearHover}")
const ind2 = array.indexOf(lastSelected),
from = Math.min(ind, ind2),
to = Math.max(ind, ind2);
for (const rangeObj of array.slice(from, to)) {
set.add(rangeObj);
// Split code for faster selection when no search query is specified
if (!this.searchQuery) {
for (const rangeObj of array.slice(from, to)) {
set.add(rangeObj);
}
} else if (tile) {
for (const rangeObj of array.slice(from, to)) {
if (getById('texture', rangeObj.tileTexture).name.toLowerCase().includes(this.searchQuery)) {
set.add(rangeObj);
}
}
} else if (copy) {
for (const rangeObj of array.slice(from, to)) {
if (rangeObj.cachedTemplate.name.toLowerCase().includes(this.searchQuery)) {
set.add(rangeObj);
}
}
}
}
set.add(object);
Expand Down

0 comments on commit 52e1151

Please sign in to comment.