AutomaticFocus

XboxJS.UI.AutomaticFocus.focusRoot

body标签 下包含class=“win-focusable” 的元素为焦点导航区域,但会排除一些条件

  • Elements that have the disabled property set
  • Windows Library for JavaScript controls that have the disabled property, and have it set to true
  • Elements with a tab index of -1 or undefined
  • Elements with a display style of “none”
  • Elements with a visibility style of “hidden”
  • Elements with a height or width of 0

单独默认焦点设置还需要js来单独实现


对于非常规页面,焦点移动 对象可以改变 通过

<div id="E" data-win-focus="{ left: '#D', right: '#F', up: '#B', down: '#H' }"></div>

D F B H 分别为不同元素的 ID, data-win-focus 便可自定义不同方向的下个焦点