MCPcopy Create free account
hub / github.com/UI5/webcomponents / _onkeyup

Method _onkeyup

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

Source from the content-addressed store, hash-verified

269 }
270
271 _onkeyup(e: KeyboardEvent) {
272 const isSpaceKey = isSpace(e);
273 const isCancelKey = isShift(e) || isEscape(e);
274
275 if (isSpaceKey || isSpaceShift(e)) {
276 if (this._cancelAction) {
277 this._cancelAction = false;
278 this._isSpacePressed = false;
279 e.preventDefault();
280 return;
281 }
282
283 this._isSpacePressed = false;
284 } else if (isCancelKey && !this._isSpacePressed) {
285 this._cancelAction = false;
286 }
287
288 if (isSpaceKey) {
289 this._selectItem(e);
290 }
291 }
292
293 _onmousedown(e: MouseEvent) {
294 const eventTarget = e.target as SegmentedButtonItem;

Callers

nothing calls this directly

Calls 5

_selectItemMethod · 0.95
isSpaceFunction · 0.85
isShiftFunction · 0.85
isEscapeFunction · 0.85
isSpaceShiftFunction · 0.85

Tested by

no test coverage detected