@noriginmedia/react-spatial-navigation
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -116,4 +116,8 @@ 'use strict'; | ||
var totalDistancePoints = primaryAxisDistance * MAIN_COORDINATE_WEIGHT + secondaryAxisDistance; | ||
var priority = totalDistancePoints / (isAdjacentSlice ? ADJACENT_SLICE_WEIGHT : DIAGONAL_SLICE_WEIGHT); | ||
/** | ||
* + 1 here is in case of distance is zero, but we still want to apply Adjacent priority weight | ||
*/ | ||
var priority = (totalDistancePoints + 1) / (isAdjacentSlice ? ADJACENT_SLICE_WEIGHT : DIAGONAL_SLICE_WEIGHT); | ||
_this.log('smartNavigate', 'distance (primary, secondary, total weighted) for ' + sibling.focusKey + ' relative to ' + focusKey + ' is', primaryAxisDistance, secondaryAxisDistance, totalDistancePoints); | ||
@@ -120,0 +124,0 @@ |
{ | ||
"name": "@noriginmedia/react-spatial-navigation", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "HOC-based Spatial Navigation (key navigation) solution for React", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -233,4 +233,8 @@ import filter from 'lodash/filter'; | ||
const totalDistancePoints = (primaryAxisDistance * MAIN_COORDINATE_WEIGHT) + secondaryAxisDistance; | ||
const priority = totalDistancePoints / (isAdjacentSlice ? ADJACENT_SLICE_WEIGHT : DIAGONAL_SLICE_WEIGHT); | ||
/** | ||
* + 1 here is in case of distance is zero, but we still want to apply Adjacent priority weight | ||
*/ | ||
const priority = (totalDistancePoints + 1) / (isAdjacentSlice ? ADJACENT_SLICE_WEIGHT : DIAGONAL_SLICE_WEIGHT); | ||
this.log( | ||
@@ -237,0 +241,0 @@ 'smartNavigate', |
4649540
2801