MCPcopy Index your code
hub / github.com/UI5/webcomponents / _onkeydown

Method _onkeydown

packages/main/src/Button.ts:581–593  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

579 }
580
581 _onkeydown(e: KeyboardEvent) {
582 if (isShift(e) || isEscape(e)) {
583 this._cancelAction = true;
584 } else if (isSpace(e)) {
585 this._isSpacePressed = true;
586 }
587
588 if ((isSpace(e) || isEnter(e))) {
589 this._setActiveState(true);
590 } else if (this._cancelAction) {
591 this._setActiveState(false);
592 }
593 }
594
595 _onkeyup(e: KeyboardEvent) {
596 const isSpaceKey = isSpace(e);

Callers

nothing calls this directly

Calls 5

_setActiveStateMethod · 0.95
isShiftFunction · 0.85
isEscapeFunction · 0.85
isSpaceFunction · 0.85
isEnterFunction · 0.85

Tested by

no test coverage detected