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

Method _handleKeydown

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

Source from the content-addressed store, hash-verified

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