Skip to content

Commit 0a7f463

Browse files
vnbaaijCopilot
andauthored
Update src/Core.Scripts/src/Components/SortableList/FluentSortableList.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5707cd2 commit 0a7f463

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Core.Scripts/src/Components/SortableList/FluentSortableList.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,9 @@ export namespace Microsoft.FluentUI.Blazor.Components.SortableList {
183183

184184
const allLists = Array.from(document.querySelectorAll(`[data-sortable-group="${group}"]`));
185185
const currentIndex = allLists.indexOf(list);
186-
let nextIndex = currentIndex;
187-
188-
if (event.key === 'ArrowRight') {
189-
nextIndex = (currentIndex + 1) % allLists.length;
190-
} else {
191-
nextIndex = (currentIndex - 1 + allLists.length) % allLists.length;
192-
}
193-
186+
const nextIndex = event.key === 'ArrowRight'
187+
? (currentIndex + 1) % allLists.length
188+
: (currentIndex - 1 + allLists.length) % allLists.length;
194189
if (nextIndex !== currentIndex) {
195190
if (isGrabbed) {
196191

0 commit comments

Comments
 (0)