Skip to content

Commit

Permalink
Fix linear moves with large elements
Browse files Browse the repository at this point in the history
The implementation incorrectly inverted the direction of movement for
both the origin point and element annotation, but it should only be done
for the origin point.
  • Loading branch information
knuton committed Aug 26, 2024
1 parent 13092ce commit b1bf849
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ function focusActiveElement(direction, origin, group) {
function focusLinear(direction, origin, group) {
const originPoint = makeOrigin(opposite(direction), origin)
const candidates = getFocusableElements(group).map((candidate) =>
annotate(opposite(direction), origin, candidate)
annotate(direction, origin, candidate)
)
const bestCandidate = getMinimumBy(candidates, (candidate) =>
euclidean(originPoint, candidate.point)
Expand Down

0 comments on commit b1bf849

Please sign in to comment.