From 854bc98abd5293de5e3e9e28eac92bfad8a3dce2 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Thu, 7 May 2026 14:19:59 +0300 Subject: [PATCH 1/2] fix: include controls without data-sap-ui attribute in control tree --- app/vendor/ToolsAPI.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/vendor/ToolsAPI.js b/app/vendor/ToolsAPI.js index a006563..a3e1d76 100644 --- a/app/vendor/ToolsAPI.js +++ b/app/vendor/ToolsAPI.js @@ -422,6 +422,24 @@ sap.ui.define(["sap/ui/core/Core", "sap/ui/core/Element", "sap/ui/core/ElementMe }); subResult = results[results.length - 1].content; + } else if (node.id && control && control.isA("sap.ui.core.Control") && typeof control.getDomRef === "function") { + // Fallback for controls (e.g. sap.ui.core.HTML) that render without data-sap-ui on their root DOM node. + var domRef; + try { + domRef = control.getDomRef(); + } catch (e) { + // getDomRef() can throw when a control is partially destroyed or mid re-render + } + if (domRef === node) { + results.push({ + id: control.getId(), + name: control.getMetadata().getName(), + type: "sap-ui-control", + content: [] + }); + + subResult = results[results.length - 1].content; + } } while (childNode) { From 67b8ad1c62b623ae2034b7f1031a91449e4e081b Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Thu, 21 May 2026 11:56:24 +0300 Subject: [PATCH 2/2] fix: address comment --- app/vendor/ToolsAPI.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/app/vendor/ToolsAPI.js b/app/vendor/ToolsAPI.js index a3e1d76..6c4ebd3 100644 --- a/app/vendor/ToolsAPI.js +++ b/app/vendor/ToolsAPI.js @@ -422,24 +422,16 @@ sap.ui.define(["sap/ui/core/Core", "sap/ui/core/Element", "sap/ui/core/ElementMe }); subResult = results[results.length - 1].content; - } else if (node.id && control && control.isA("sap.ui.core.Control") && typeof control.getDomRef === "function") { + } else if (node.id && control && control.isA("sap.ui.core.Control") && control.getDomRef && control.getDomRef() === node) { // Fallback for controls (e.g. sap.ui.core.HTML) that render without data-sap-ui on their root DOM node. - var domRef; - try { - domRef = control.getDomRef(); - } catch (e) { - // getDomRef() can throw when a control is partially destroyed or mid re-render - } - if (domRef === node) { - results.push({ - id: control.getId(), - name: control.getMetadata().getName(), - type: "sap-ui-control", - content: [] - }); - - subResult = results[results.length - 1].content; - } + results.push({ + id: control.getId(), + name: control.getMetadata().getName(), + type: "sap-ui-control", + content: [] + }); + + subResult = results[results.length - 1].content; } while (childNode) {