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