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

Method _onkeydown

packages/main/src/SegmentedButton.ts:260–269  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

258 }
259
260 _onkeydown(e: KeyboardEvent) {
261 if (isEnter(e)) {
262 this._selectItem(e);
263 } else if (isSpace(e)) {
264 e.preventDefault(); // Prevent scrolling
265 this._isSpacePressed = true;
266 } else if (isShift(e) || isEscape(e)) {
267 this._cancelAction = true; // Set the flag to cancel the action
268 }
269 }
270
271 _onkeyup(e: KeyboardEvent) {
272 const isSpaceKey = isSpace(e);

Callers

nothing calls this directly

Calls 5

_selectItemMethod · 0.95
isEnterFunction · 0.85
isSpaceFunction · 0.85
isShiftFunction · 0.85
isEscapeFunction · 0.85

Tested by

no test coverage detected