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

Method _onKeyUp

packages/main/src/SplitButton.ts:314–343  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

312 }
313
314 _onKeyUp(e: KeyboardEvent) {
315 const target = e.target as Button;
316 if (this._isArrowKeyAction(e)) {
317 e.preventDefault();
318 this._activeArrowButton = false;
319 return;
320 }
321
322 if (isSpace(e)) {
323 e.preventDefault();
324 e.stopPropagation();
325 this._textButtonActive = false;
326 if (!this._shiftOrEscapePressedDuringSpace) { // Do not fire click if Arrow button is focused by mouse and Space is pressed afterwards
327 if (target !== this.arrowButton) {
328 this._fireClick();
329 } else {
330 this._fireArrowClick();
331 }
332 }
333
334 this._shiftOrEscapePressedDuringSpace = false;
335 return;
336 }
337
338 const shouldToggleTextButtonActiveStateOff = isEnter(e) || (isShift(e) && this._textButtonActive);
339
340 if (shouldToggleTextButtonActiveStateOff) {
341 this._textButtonActive = false;
342 }
343 }
344
345 _resetActionButtonStates() {
346 this._activeArrowButton = false;

Callers

nothing calls this directly

Calls 6

_isArrowKeyActionMethod · 0.95
_fireClickMethod · 0.95
_fireArrowClickMethod · 0.95
isSpaceFunction · 0.85
isEnterFunction · 0.85
isShiftFunction · 0.85

Tested by

no test coverage detected