Re: [csswg-drafts] Tweak the distance function to prioritize elements that are aligned (#3361)

---

Migrated from https://github.com/WICG/spatial-navigation/issues/122#issuecomment-437250623
Originally created by @jihyerish on *Fri, 09 Nov 2018 04:58:48 GMT*

---
@hugoholgersson 
Yes, I agree with you. Measuring the distance depending on the centroid can achieve the more precise result.

I've been also considering the case that you described above. 
To cover this case, the span element is considered as the two [fragment](https://www.w3.org/TR/css-break-3/#box-fragment)s.
So inside the element's border box, the closest fragment from the edge which is on the direction of the navigation will be selected to use for calculating the distance.

In your example, if the user presses the down arrow key, from the "XXXXXXX" fragment in the second line the distance value will be calculated.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3361#issuecomment-443616381 using your GitHub account

Received on Monday, 3 December 2018 07:42:16 UTC