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

Method _onTabStripKeyDown

packages/main/src/TabContainer.ts:811–847  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

809 }
810
811 _onTabStripKeyDown(e: KeyboardEvent) {
812 const tab = getTabInStrip(e.target as HTMLElement);
813 if (!tab) {
814 return;
815 }
816
817 if (isCtrl(e) && tab.realTabReference.movable && isMovingKey(e.key)) {
818 this._moveHeaderItem(tab.realTabReference, e);
819 e.preventDefault();
820 return;
821 }
822
823 if (tab.realTabReference.disabled) {
824 return;
825 }
826
827 if (isEnter(e)) {
828 if (tab.realTabReference.isSingleClickArea) {
829 this._onTabStripClick(e);
830 } else {
831 this._onHeaderItemSelect(tab, e);
832 }
833 }
834
835 if (isSpace(e)) {
836 e.preventDefault(); // prevent scrolling
837 }
838
839 if (isDown(e) || isUp(e)) {
840 if (tab.realTabReference.requiresExpandButton) {
841 this._onTabExpandButtonClick(e);
842 }
843 if (tab.realTabReference.isSingleClickArea) {
844 this._onTabStripClick(e);
845 }
846 }
847 }
848
849 _onTabStripKeyUp(e: KeyboardEvent) {
850 const tab = getTabInStrip(e.target as HTMLElement);

Callers

nothing calls this directly

Calls 11

_moveHeaderItemMethod · 0.95
_onTabStripClickMethod · 0.95
_onHeaderItemSelectMethod · 0.95
getTabInStripFunction · 0.85
isCtrlFunction · 0.85
isMovingKeyFunction · 0.85
isEnterFunction · 0.85
isSpaceFunction · 0.85
isDownFunction · 0.85
isUpFunction · 0.85

Tested by

no test coverage detected