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

Method _toggleOnInteraction

src/material/sort/sort-header.ts:173–180  ·  view source on GitHub ↗

Triggers the sort on this sort header and removes the indicator hint.

()

Source from the content-addressed store, hash-verified

171
172 /** Triggers the sort on this sort header and removes the indicator hint. */
173 _toggleOnInteraction() {
174 if (!this._isDisabled()) {
175 const wasSorted = this._isSorted();
176 const prevDirection = this._sort.direction;
177 this._sort.sort(this);
178 this._recentlyCleared.set(wasSorted && !this._isSorted() ? prevDirection : null);
179 }
180 }
181
182 _handleKeydown(event: KeyboardEvent) {
183 if (event.keyCode === SPACE || event.keyCode === ENTER) {

Callers 1

_handleKeydownMethod · 0.95

Calls 4

_isDisabledMethod · 0.95
_isSortedMethod · 0.95
setMethod · 0.80
sortMethod · 0.65

Tested by

no test coverage detected