fix(inputs): keyboard focus improvements (#16838)

fixes #16815
fixes #16872
fixes #13978
fixes #16610
This commit is contained in:
Manu MA
2019-01-11 19:36:02 +01:00
committed by GitHub
parent 275d385c17
commit 6364e4e2a1
38 changed files with 263 additions and 234 deletions

View File

@ -1,4 +1,4 @@
import { Component, ComponentInterface, Element, Prop } from '@stencil/core';
import { Component, ComponentInterface, Element, Listen, Prop } from '@stencil/core';
import { Color, Mode } from '../../interface';
import { createColorClasses } from '../../utils/theme';
@ -43,9 +43,12 @@ export class ItemOption implements ComponentInterface {
*/
@Prop() href?: string;
private clickedOptionButton(ev: Event): boolean {
@Listen('click')
onClick(ev: Event) {
const el = (ev.target as HTMLElement).closest('ion-item-option');
return !!el;
if (el) {
ev.preventDefault();
}
}
hostData() {
@ -67,7 +70,6 @@ export class ItemOption implements ComponentInterface {
class="button-native"
disabled={this.disabled}
href={this.href}
onClick={this.clickedOptionButton.bind(this)}
>
<span class="button-inner">
<slot name="start"></slot>