Merge pull request #76 from mixer/bugfix/input-button

Bugfix/input button
This commit is contained in:
Kewei Li 2017-10-25 17:15:08 -07:00 коммит произвёл GitHub
Родитель 69b008c9f0 cbb4266d1d
Коммит 388e125b62
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -18,7 +18,7 @@ We use [WinJS' navigation algorithm](https://github.com/winjs/winjs/blob/master/
For the majority of navigation, we represent controller actions as keyboard events; the left joystick or arrow keys on a keyboard can be used to fire up, down, left, and right events in order to navigate the page. We determine the next element to focus in a direction using WinJS' algorithm based on each focusable element's physical location, but you can also fine tune what happens when via directives. This can help to avoid [inaccessible UI](https://msdn.microsoft.com/windows/uwp/input-and-devices/designing-for-tv#inaccessible-ui) and provide more fined-tuned experiences on each platform. For the majority of navigation, we represent controller actions as keyboard events; the left joystick or arrow keys on a keyboard can be used to fire up, down, left, and right events in order to navigate the page. We determine the next element to focus in a direction using WinJS' algorithm based on each focusable element's physical location, but you can also fine tune what happens when via directives. This can help to avoid [inaccessible UI](https://msdn.microsoft.com/windows/uwp/input-and-devices/designing-for-tv#inaccessible-ui) and provide more fined-tuned experiences on each platform.
> By default only elements that explicity have `tabindex > 0` are considered for focus > By default only elements that explicity have `tabindex >= 0` are considered for focus
## Demo App ## Demo App

Просмотреть файл

@ -179,7 +179,7 @@ function isForForm(direction: Direction, selected: HTMLElement | null): boolean
if (direction === Direction.SUBMIT) { if (direction === Direction.SUBMIT) {
let parent: HTMLElement | null = selected; let parent: HTMLElement | null = selected;
while (parent) { while (parent) {
if (parent.tagName === 'FORM' || parent.tagName === 'INPUT' || parent.tagName === 'TEXTAREA') { if (parent.tagName === 'FORM' || (parent.tagName === 'INPUT' && (<HTMLInputElement>parent).type !== 'button') || parent.tagName === 'TEXTAREA') {
return true; return true;
} }
parent = parent.parentElement; parent = parent.parentElement;