MCPcopy
hub / github.com/angular/components / _handleKeydown

Method _handleKeydown

src/material/chips/chip-row.ts:156–170  ·  view source on GitHub ↗
(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

154 }
155
156 override _handleKeydown(event: KeyboardEvent): void {
157 if (event.keyCode === ENTER && !this.disabled) {
158 if (this._isEditing) {
159 event.preventDefault();
160 this._onEditFinish();
161 } else if (this.editable) {
162 this._startEditing(event);
163 }
164 } else if (this._isEditing) {
165 // Stop the event from reaching the chip set in order to avoid navigating.
166 event.stopPropagation();
167 } else {
168 super._handleKeydown(event);
169 }
170 }
171
172 _handleClick(event: MouseEvent) {
173 if (!this.disabled && this.editable && !this._isEditing && this._alreadyFocused) {

Callers

nothing calls this directly

Calls 2

_onEditFinishMethod · 0.95
_startEditingMethod · 0.95

Tested by

no test coverage detected