diff --git a/packages/applet/src/components/state/StateFieldViewer.vue b/packages/applet/src/components/state/StateFieldViewer.vue
index a26c03a5c..8f8f48e3d 100644
--- a/packages/applet/src/components/state/StateFieldViewer.vue
+++ b/packages/applet/src/components/state/StateFieldViewer.vue
@@ -80,6 +80,25 @@ const normalizedDisplayedValue = computed(() => {
}
})
+const valueTooltip = computed(() => {
+ const tooltip = {
+ content: '',
+ disabled: true,
+ html: true,
+ }
+
+ if (type.value === 'custom') {
+ const tooltipText = (props.data.value as InspectorCustomState)?._custom?.tooltipText
+
+ if (tooltipText) {
+ tooltip.content = tooltipText
+ tooltip.disabled = false
+ }
+ }
+
+ return tooltip
+})
+
// normalized display children
const normalizedDisplayedChildren = computed(() => {
const { value, inherit, customType } = raw.value
@@ -205,7 +224,7 @@ async function submitDrafting() {
:
-
+
function ${escape(name)}${args}`,
- tooltipText: string.trim() ? `${string}` : null,
+ tooltipText: string.trim() ? `${escape(string)}` : null,
},
}
}
@@ -249,7 +249,7 @@ export function getObjectDetails(object: Record) {
type: stateTypeName?.toLowerCase(),
stateTypeName,
value,
- ...raw ? { tooltipText: `${raw}` } : {},
+ ...raw ? { tooltipText: `${escape(raw)}` } : {},
},
}
}