@@ -840,6 +840,17 @@ describe('MatSelectionList without forms', () => {
840840 expect ( selectList . selected . length ) . toBe ( 0 ) ;
841841 } ) ;
842842
843+ it ( 'should not show a pointer cursor around radios in disabled single-selection lists' , ( ) => {
844+ fixture . destroy ( ) ;
845+
846+ const singleSelectionFixture = TestBed . createComponent ( DisabledSingleSelectionList ) ;
847+ singleSelectionFixture . detectChanges ( ) ;
848+
849+ const radio = singleSelectionFixture . nativeElement . querySelector ( '.mdc-radio' ) ! ;
850+
851+ expect ( getComputedStyle ( radio ) . cursor ) . toBe ( 'auto' ) ;
852+ } ) ;
853+
843854 it ( 'should update state of options if list state has changed' , ( ) => {
844855 const testOption = listOption [ 2 ] . componentInstance as MatListOption ;
845856
@@ -1699,7 +1710,7 @@ describe('MatSelectionList with forms', () => {
16991710 }
17001711 </mat-selection-list>` ,
17011712 imports : [ MatListModule ] ,
1702- changeDetection : ChangeDetectionStrategy . Eager ,
1713+ changeDetection : ChangeDetectionStrategy . Default ,
17031714} )
17041715class SelectionListWithListOptions {
17051716 showLastOption = true ;
@@ -1728,7 +1739,7 @@ class SelectionListWithListOptions {
17281739 </mat-list-option>
17291740 </mat-selection-list>` ,
17301741 imports : [ MatListModule ] ,
1731- changeDetection : ChangeDetectionStrategy . Eager ,
1742+ changeDetection : ChangeDetectionStrategy . Default ,
17321743} )
17331744class SelectionListWithCheckboxPositionAfter { }
17341745
@@ -1749,20 +1760,30 @@ class SelectionListWithCheckboxPositionAfter {}
17491760 </mat-list-option>
17501761 </mat-selection-list>` ,
17511762 imports : [ MatListModule ] ,
1752- changeDetection : ChangeDetectionStrategy . Eager ,
1763+ changeDetection : ChangeDetectionStrategy . Default ,
17531764} )
17541765class SelectionListWithListDisabled {
17551766 disabled : boolean = true ;
17561767}
17571768
1769+ @Component ( {
1770+ template : `
1771+ <mat-selection-list [disabled]="true" [multiple]="false">
1772+ <mat-list-option>Inbox</mat-list-option>
1773+ </mat-selection-list>` ,
1774+ imports : [ MatListModule ] ,
1775+ changeDetection : ChangeDetectionStrategy . Default ,
1776+ } )
1777+ class DisabledSingleSelectionList { }
1778+
17581779@Component ( {
17591780 template : `
17601781 <mat-selection-list>
17611782 <mat-list-option [disabled]="disableItem">Item</mat-list-option>
17621783 </mat-selection-list>
17631784 ` ,
17641785 imports : [ MatListModule ] ,
1765- changeDetection : ChangeDetectionStrategy . Eager ,
1786+ changeDetection : ChangeDetectionStrategy . Default ,
17661787} )
17671788class SelectionListWithDisabledOption {
17681789 disableItem : boolean = false ;
@@ -1777,7 +1798,7 @@ class SelectionListWithDisabledOption {
17771798 <mat-list-option>Not selected - Item #4</mat-list-option>
17781799 </mat-selection-list>` ,
17791800 imports : [ MatListModule ] ,
1780- changeDetection : ChangeDetectionStrategy . Eager ,
1801+ changeDetection : ChangeDetectionStrategy . Default ,
17811802} )
17821803class SelectionListWithSelectedOption { }
17831804
@@ -1788,7 +1809,7 @@ class SelectionListWithSelectedOption {}
17881809 <mat-list-option [selected]="true">Pre-selected - Item #2</mat-list-option>
17891810 </mat-selection-list>` ,
17901811 imports : [ MatListModule ] ,
1791- changeDetection : ChangeDetectionStrategy . Eager ,
1812+ changeDetection : ChangeDetectionStrategy . Default ,
17921813} )
17931814class SingleSelectionListWithSelectedOption { }
17941815
@@ -1798,7 +1819,7 @@ class SingleSelectionListWithSelectedOption {}
17981819 <mat-list-option [selected]="true" [value]="itemValue">Item</mat-list-option>
17991820 </mat-selection-list>` ,
18001821 imports : [ MatListModule ] ,
1801- changeDetection : ChangeDetectionStrategy . Eager ,
1822+ changeDetection : ChangeDetectionStrategy . Default ,
18021823} )
18031824class SelectionListWithSelectedOptionAndValue {
18041825 itemValue = 'item1' ;
@@ -1815,7 +1836,7 @@ class SelectionListWithSelectedOptionAndValue {
18151836 }
18161837 </mat-selection-list>` ,
18171838 imports : [ MatListModule , FormsModule , ReactiveFormsModule ] ,
1818- changeDetection : ChangeDetectionStrategy . Eager ,
1839+ changeDetection : ChangeDetectionStrategy . Default ,
18191840} )
18201841class SelectionListWithModel {
18211842 modelChangeSpy = jasmine . createSpy ( 'model change spy' ) ;
@@ -1838,7 +1859,7 @@ class SelectionListWithModel {
18381859 }
18391860 ` ,
18401861 imports : [ MatListModule , FormsModule , ReactiveFormsModule ] ,
1841- changeDetection : ChangeDetectionStrategy . Eager ,
1862+ changeDetection : ChangeDetectionStrategy . Default ,
18421863} )
18431864class SelectionListWithFormControl {
18441865 formControl = new FormControl ( [ ] as string [ ] ) ;
@@ -1853,7 +1874,7 @@ class SelectionListWithFormControl {
18531874 <mat-list-option value="opt2" selected>Option 2</mat-list-option>
18541875 </mat-selection-list>` ,
18551876 imports : [ MatListModule , FormsModule , ReactiveFormsModule ] ,
1856- changeDetection : ChangeDetectionStrategy . Eager ,
1877+ changeDetection : ChangeDetectionStrategy . Default ,
18571878} )
18581879class SelectionListWithPreselectedOption {
18591880 selectedOptions ! : string [ ] ;
@@ -1866,7 +1887,7 @@ class SelectionListWithPreselectedOption {
18661887 <mat-list-option value="opt2" selected>Option 2</mat-list-option>
18671888 </mat-selection-list>` ,
18681889 imports : [ MatListModule , FormsModule , ReactiveFormsModule ] ,
1869- changeDetection : ChangeDetectionStrategy . Eager ,
1890+ changeDetection : ChangeDetectionStrategy . Default ,
18701891} )
18711892class SelectionListWithPreselectedOptionAndModel {
18721893 selectedOptions = [ 'opt1' ] ;
@@ -1895,7 +1916,7 @@ class SelectionListWithPreselectedFormControlOnPush {
18951916 }
18961917 </mat-selection-list>` ,
18971918 imports : [ MatListModule , FormsModule , ReactiveFormsModule ] ,
1898- changeDetection : ChangeDetectionStrategy . Eager ,
1919+ changeDetection : ChangeDetectionStrategy . Default ,
18991920} )
19001921class SelectionListWithCustomComparator {
19011922 @ViewChildren ( MatListOption ) optionInstances ! : QueryList < MatListOption > ;
@@ -1918,7 +1939,7 @@ class SelectionListWithCustomComparator {
19181939 </mat-selection-list>
19191940 ` ,
19201941 imports : [ MatListModule ] ,
1921- changeDetection : ChangeDetectionStrategy . Eager ,
1942+ changeDetection : ChangeDetectionStrategy . Default ,
19221943} )
19231944class SelectionListWithAvatar {
19241945 togglePosition ! : MatListOptionTogglePosition ;
@@ -1934,7 +1955,7 @@ class SelectionListWithAvatar {
19341955 </mat-selection-list>
19351956 ` ,
19361957 imports : [ MatListModule ] ,
1937- changeDetection : ChangeDetectionStrategy . Eager ,
1958+ changeDetection : ChangeDetectionStrategy . Default ,
19381959} )
19391960class SelectionListWithIcon {
19401961 togglePosition ! : MatListOptionTogglePosition ;
@@ -1950,7 +1971,7 @@ class SelectionListWithIcon {
19501971 }
19511972 </mat-selection-list>` ,
19521973 imports : [ MatListModule ] ,
1953- changeDetection : ChangeDetectionStrategy . Eager ,
1974+ changeDetection : ChangeDetectionStrategy . Default ,
19541975} )
19551976class SelectionListWithIndirectChildOptions {
19561977 @ViewChildren ( MatListOption ) optionInstances ! : QueryList < MatListOption > ;
@@ -1963,7 +1984,7 @@ class SelectionListWithIndirectChildOptions {
19631984 </mat-selection-list>
19641985` ,
19651986 imports : [ MatListModule ] ,
1966- changeDetection : ChangeDetectionStrategy . Eager ,
1987+ changeDetection : ChangeDetectionStrategy . Default ,
19671988} )
19681989class ListOptionWithTwoWayBinding {
19691990 selected = false ;
0 commit comments