mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
compat: selection list not working in compatibility mode (#6801)
Fixes the selection list not working in M1 compatibility mode. Fixes #6746.
This commit is contained in:
committed by
tinayuangao
parent
87d607e719
commit
f1b78d4c5f
@@ -1,10 +1,16 @@
|
||||
<div class="mat-list-item-content" [class.mat-list-item-content-reverse]="checkboxPosition == 'after'" [class.mat-list-item-disabled]="disabled">
|
||||
<div class="mat-list-item-ripple" md-ripple
|
||||
[mdRippleTrigger]="_getHostElement()"
|
||||
[mdRippleDisabled]="_isRippleDisabled()">
|
||||
</div>
|
||||
<div class="mat-list-item-content"
|
||||
[class.mat-list-item-content-reverse]="checkboxPosition == 'after'"
|
||||
[class.mat-list-item-disabled]="disabled">
|
||||
|
||||
<div md-ripple
|
||||
class="mat-list-item-ripple"
|
||||
[mdRippleTrigger]="_getHostElement()"
|
||||
[mdRippleDisabled]="_isRippleDisabled()"></div>
|
||||
|
||||
<md-pseudo-checkbox #autocheckbox
|
||||
[state]="selected ? 'checked' : 'unchecked'"
|
||||
[disabled]="disabled"></md-pseudo-checkbox>
|
||||
|
||||
<md-pseudo-checkbox [state]="selected ? 'checked' : 'unchecked'" #autocheckbox [disabled]="disabled"></md-pseudo-checkbox>
|
||||
<div class="mat-list-text"><ng-content></ng-content></div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,8 @@ import {CanDisable, mixinDisabled} from '../core/common-behaviors/disabled';
|
||||
import {RxChain, switchMap, startWith} from '../core/rxjs/index';
|
||||
import {merge} from 'rxjs/observable/merge';
|
||||
import {CanDisableRipple, mixinDisableRipple} from '../core/common-behaviors/disable-ripple';
|
||||
import {MATERIAL_COMPATIBILITY_MODE} from '../core/compatibility/compatibility';
|
||||
|
||||
|
||||
export class MdSelectionListBase {}
|
||||
export const _MdSelectionListMixinBase = mixinDisableRipple(mixinDisabled(MdSelectionListBase));
|
||||
@@ -68,14 +70,14 @@ const FOCUSED_STYLE: string = 'mat-list-item-focus';
|
||||
},
|
||||
templateUrl: 'list-option.html',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [{provide: MATERIAL_COMPATIBILITY_MODE, useValue: false}],
|
||||
})
|
||||
export class MdListOption extends _MdListOptionMixinBase
|
||||
implements AfterContentInit, OnDestroy, FocusableOption, CanDisableRipple {
|
||||
|
||||
private _lineSetter: MdLineSetter;
|
||||
private _selected: boolean = false;
|
||||
/** Whether the checkbox is disabled. */
|
||||
private _disabled: boolean = false;
|
||||
private _value: any;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user