option.ts (material2-7.3.6) | : | option.ts (material2-7.3.7) | ||
---|---|---|---|---|
skipping to change at line 75 | skipping to change at line 75 | |||
moduleId: module.id, | moduleId: module.id, | |||
selector: 'mat-option', | selector: 'mat-option', | |||
exportAs: 'matOption', | exportAs: 'matOption', | |||
host: { | host: { | |||
'role': 'option', | 'role': 'option', | |||
'[attr.tabindex]': '_getTabIndex()', | '[attr.tabindex]': '_getTabIndex()', | |||
'[class.mat-selected]': 'selected', | '[class.mat-selected]': 'selected', | |||
'[class.mat-option-multiple]': 'multiple', | '[class.mat-option-multiple]': 'multiple', | |||
'[class.mat-active]': 'active', | '[class.mat-active]': 'active', | |||
'[id]': 'id', | '[id]': 'id', | |||
'[attr.aria-selected]': 'selected.toString()', | '[attr.aria-selected]': '_getAriaSelected()', | |||
'[attr.aria-disabled]': 'disabled.toString()', | '[attr.aria-disabled]': 'disabled.toString()', | |||
'[class.mat-option-disabled]': 'disabled', | '[class.mat-option-disabled]': 'disabled', | |||
'(click)': '_selectViaInteraction()', | '(click)': '_selectViaInteraction()', | |||
'(keydown)': '_handleKeydown($event)', | '(keydown)': '_handleKeydown($event)', | |||
'class': 'mat-option', | 'class': 'mat-option', | |||
}, | }, | |||
styleUrls: ['option.css'], | styleUrls: ['option.css'], | |||
templateUrl: 'option.html', | templateUrl: 'option.html', | |||
encapsulation: ViewEncapsulation.None, | encapsulation: ViewEncapsulation.None, | |||
changeDetection: ChangeDetectionStrategy.OnPush, | changeDetection: ChangeDetectionStrategy.OnPush, | |||
skipping to change at line 223 | skipping to change at line 223 | |||
* determine if the select's view -> model callback should be invoked.` | * determine if the select's view -> model callback should be invoked.` | |||
*/ | */ | |||
_selectViaInteraction(): void { | _selectViaInteraction(): void { | |||
if (!this.disabled) { | if (!this.disabled) { | |||
this._selected = this.multiple ? !this._selected : true; | this._selected = this.multiple ? !this._selected : true; | |||
this._changeDetectorRef.markForCheck(); | this._changeDetectorRef.markForCheck(); | |||
this._emitSelectionChangeEvent(true); | this._emitSelectionChangeEvent(true); | |||
} | } | |||
} | } | |||
/** | ||||
* Gets the `aria-selected` value for the option. We explicitly omit the `aria | ||||
-selected` | ||||
* attribute from single-selection, unselected options. Including the `aria-se | ||||
lected="false"` | ||||
* attributes adds a significant amount of noise to screen-reader users withou | ||||
t providing useful | ||||
* information. | ||||
*/ | ||||
_getAriaSelected(): boolean|null { | ||||
return this.selected || (this.multiple ? false : null); | ||||
} | ||||
/** Returns the correct tabindex for the option depending on disabled state. * / | /** Returns the correct tabindex for the option depending on disabled state. * / | |||
_getTabIndex(): string { | _getTabIndex(): string { | |||
return this.disabled ? '-1' : '0'; | return this.disabled ? '-1' : '0'; | |||
} | } | |||
/** Gets the host DOM element. */ | /** Gets the host DOM element. */ | |||
_getHostElement(): HTMLElement { | _getHostElement(): HTMLElement { | |||
return this._element.nativeElement; | return this._element.nativeElement; | |||
} | } | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 14 lines changed or added |