mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
perf(toggle): toggle’s button is not activated
This commit is contained in:
@ -70,7 +70,7 @@ export const TOGGLE_VALUE_ACCESSOR: any = {
|
|||||||
'[attr.aria-checked]="_value" ' +
|
'[attr.aria-checked]="_value" ' +
|
||||||
'[attr.aria-labelledby]="_labelId" ' +
|
'[attr.aria-labelledby]="_labelId" ' +
|
||||||
'[attr.aria-disabled]="_disabled" ' +
|
'[attr.aria-disabled]="_disabled" ' +
|
||||||
'class="item-cover">' +
|
'class="item-cover" disable-activated>' +
|
||||||
'</button>',
|
'</button>',
|
||||||
host: {
|
host: {
|
||||||
'[class.toggle-disabled]': '_disabled'
|
'[class.toggle-disabled]': '_disabled'
|
||||||
|
@ -6,10 +6,12 @@ import { PointerCoordinates } from '../util/dom';
|
|||||||
|
|
||||||
|
|
||||||
export class Activator implements ActivatorBase {
|
export class Activator implements ActivatorBase {
|
||||||
|
|
||||||
protected _queue: HTMLElement[] = [];
|
protected _queue: HTMLElement[] = [];
|
||||||
protected _active: HTMLElement[] = [];
|
protected _active: HTMLElement[] = [];
|
||||||
protected _activeDefer: Function;
|
protected _activeDefer: Function;
|
||||||
protected _clearDefer: Function;
|
protected _clearDefer: Function;
|
||||||
|
|
||||||
_css: string;
|
_css: string;
|
||||||
activatedDelay = ADD_ACTIVATED_DEFERS;
|
activatedDelay = ADD_ACTIVATED_DEFERS;
|
||||||
clearDelay = CLEAR_STATE_DEFERS;
|
clearDelay = CLEAR_STATE_DEFERS;
|
||||||
@ -19,6 +21,9 @@ export class Activator implements ActivatorBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clickAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates) {
|
clickAction(ev: UIEvent, activatableEle: HTMLElement, startCoord: PointerCoordinates) {
|
||||||
|
if (isActivatedDisabled(ev, activatableEle)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// a click happened, so immediately deactive all activated elements
|
// a click happened, so immediately deactive all activated elements
|
||||||
this._scheduleClear();
|
this._scheduleClear();
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import { UIEventManager } from '../gestures/ui-event-manager';
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TapClick {
|
export class TapClick {
|
||||||
|
|
||||||
private disableClick: number = 0;
|
private disableClick: number = 0;
|
||||||
private usePolyfill: boolean;
|
private usePolyfill: boolean;
|
||||||
private activator: ActivatorBase;
|
private activator: ActivatorBase;
|
||||||
@ -236,7 +237,7 @@ function getActivatableTarget(ele: HTMLElement): any {
|
|||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
export const isActivatable = function (ele: HTMLElement) {
|
export function isActivatable(ele: HTMLElement) {
|
||||||
if (ACTIVATABLE_ELEMENTS.indexOf(ele.tagName) > -1) {
|
if (ACTIVATABLE_ELEMENTS.indexOf(ele.tagName) > -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user