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

Method _onkeydown

packages/main/src/Select.ts:682–708  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

680 }
681
682 _onkeydown(e: KeyboardEvent) {
683 const isTab = (isTabNext(e) || isTabPrevious(e));
684
685 if (isTab && this._isPickerOpen) {
686 this.responsivePopover.open = false;
687 } else if (isShow(e)) {
688 e.preventDefault();
689 this._toggleRespPopover();
690 } else if (isSpace(e)) {
691 e.preventDefault();
692 } else if (isEscape(e) && this._isPickerOpen) {
693 this._escapePressed = true;
694 } else if (isHome(e)) {
695 this._handleHomeKey(e);
696 } else if (isEnd(e)) {
697 this._handleEndKey(e);
698 // When focus is on the list item, Enter triggers _handleItemPress via the List item-click
699 // event, which already calls _handleSelectionChange and prevents default.
700 // Skip here to avoid a double selection change.
701 } else if (isEnter(e) && !e.defaultPrevented) {
702 this._handleSelectionChange();
703 } else if (isUp(e) || isDown(e)) {
704 this._handleArrowNavigation(e);
705 } else if (isPrintableCharacter(e)) {
706 this._handleKeyboardNavigation(e);
707 }
708 }
709
710 _handleKeyboardNavigation(e: KeyboardEvent) {
711 if (this.readonly) {

Callers

nothing calls this directly

Calls 15

_toggleRespPopoverMethod · 0.95
_handleHomeKeyMethod · 0.95
_handleEndKeyMethod · 0.95
isTabNextFunction · 0.85
isTabPreviousFunction · 0.85
isShowFunction · 0.85
isSpaceFunction · 0.85
isEscapeFunction · 0.85
isHomeFunction · 0.85

Tested by

no test coverage detected