Format composer menu highlight helper
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
3666f713e4
commit
669d274bf9
1 file changed
+1
-2
@@ -29,8 +29,7 @@ export function resolveComposerMenuNudgedItemId(input: {
|
||||
}
|
||||
|
||||
const activeIndex = input.items.findIndex((item) => item.id === input.activeItemId);
|
||||
const normalizedIndex =
|
||||
activeIndex >= 0 ? activeIndex : input.direction === "next" ? -1 : 0;
|
||||
const normalizedIndex = activeIndex >= 0 ? activeIndex : input.direction === "next" ? -1 : 0;
|
||||
const offset = input.direction === "next" ? 1 : -1;
|
||||
const nextIndex = (normalizedIndex + offset + input.items.length) % input.items.length;
|
||||
|
||||
|
||||
Reference in new issue
Block a user