Merge pull request #76 from mixer/bugfix/input-button
Bugfix/input button
This commit is contained in:
Коммит
388e125b62
|
@ -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;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче