diff --git a/src/components.d.ts b/src/components.d.ts index d172d3da..920e32b4 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -1303,7 +1303,7 @@ export namespace Components { } interface SlTooltip { /** - * The tooltip's content. + * The tooltip's content. Alternatively, you can use the content slot. */ "content": string; /** @@ -3001,7 +3001,7 @@ declare namespace LocalJSX { } interface SlTooltip { /** - * The tooltip's content. + * The tooltip's content. Alternatively, you can use the content slot. */ "content"?: string; /** diff --git a/src/components/tooltip/tooltip.tsx b/src/components/tooltip/tooltip.tsx index 0bb12990..30fc2aae 100644 --- a/src/components/tooltip/tooltip.tsx +++ b/src/components/tooltip/tooltip.tsx @@ -28,7 +28,7 @@ export class Tooltip { @Element() host: HTMLSlTooltipElement; - /** The tooltip's content. */ + /** The tooltip's content. Alternatively, you can use the content slot. */ @Prop() content = ''; /** @@ -162,7 +162,11 @@ export class Tooltip { } getTarget() { - const target = this.host.querySelector('*:not(style)') as HTMLElement; + // Get the first child that isn't a