MCPcopy Create free account
hub / github.com/angular/components / _toggleOnInteraction

Method _toggleOnInteraction

src/material/list/list-option.ts:298–308  ·  view source on GitHub ↗

Toggles the option's value based on a user interaction.

()

Source from the content-addressed store, hash-verified

296
297 /** Toggles the option's value based on a user interaction. */
298 _toggleOnInteraction() {
299 if (!this.disabled) {
300 if (this._selectionList.multiple) {
301 this.selected = !this.selected;
302 this._selectionList._emitChangeEvent([this]);
303 } else if (!this.selected) {
304 this.selected = true;
305 this._selectionList._emitChangeEvent([this]);
306 }
307 }
308 }
309
310 /** Sets the tabindex of the list option. */
311 _setTabindex(value: number) {

Callers 1

_handleKeydownMethod · 0.45

Calls 1

_emitChangeEventMethod · 0.65

Tested by

no test coverage detected