diff --git a/packages/main/src/BusyIndicator.js b/packages/main/src/BusyIndicator.js
index 64d295f267c4..b4fdc671d007 100644
--- a/packages/main/src/BusyIndicator.js
+++ b/packages/main/src/BusyIndicator.js
@@ -95,6 +95,30 @@ class BusyIndicator extends UI5Element {
super();
this.i18nBundle = getI18nBundle("@ui5/webcomponents");
+ this._preventHandler = this._preventEvent.bind(this);
+ }
+
+ onBeforeRendering() {
+ if (this.active) {
+ this.tabIndex = -1;
+ } else {
+ this.tabIndex = 0;
+ }
+ }
+
+ onEnterDOM() {
+ this.addEventListener("keyup", this._preventHandler, {
+ capture: true,
+ });
+
+ this.addEventListener("keydown", this._preventHandler, {
+ capture: true,
+ });
+ }
+
+ onExitDOM() {
+ this.removeEventListener("keyup", this._preventHandler, true);
+ this.removeEventListener("keydown", this._preventHandler, true);
}
static get metadata() {
@@ -123,6 +147,12 @@ class BusyIndicator extends UI5Element {
get ariaTitle() {
return this.i18nBundle.getText(BUSY_INDICATOR_TITLE);
}
+
+ _preventEvent(event) {
+ if (this.active) {
+ event.stopImmediatePropagation();
+ }
+ }
}
BusyIndicator.define();
diff --git a/packages/main/test/pages/BusyIndicator.html b/packages/main/test/pages/BusyIndicator.html
index 81c7d09428ff..6ccd82c951c8 100644
--- a/packages/main/test/pages/BusyIndicator.html
+++ b/packages/main/test/pages/BusyIndicator.html
@@ -112,6 +112,24 @@
+
+
+
+ Dynamic tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+