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

---

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/3388#issuecomment-443619577 using your GitHub account

Received on Monday, 3 December 2018 07:55:03 UTC