Skip to content

[Tooltip] Some issue about Tooltip when using with "slot" #514

Open
@KiddoV

Description

@KiddoV

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

  1. Typescript would yell for label props when using Tooltip with a slot:
<Tooltip opened position="left" withArrow>
    <div slot="label">Some text...</div>
</Tooltip>

VsCode yells:

Property 'label' is missing in type '{ opened: true; position: "left"; withArrow: true; }' but required in type '{ class?: string; label: any; opened?: boolean; openDelay?: number; closeDelay?: number; color?: SvelteUIColor; radius?: SvelteUINumberSize; disabled?: boolean; ... 243 more ...; 'on:fullscreenerror'?: EventHandler<...>; }'.ts(2741)
  1. The position is broken when using tooltip with slot
<Tooltip opened position="left" withArrow> <!-- <== Cannot change position of the tooltip anymore, it would always on the right side -->
    <div slot="label">Text...</div>
    <div></div>
</Tooltip>

In which browser(s) did the problem occur?

Microsoft Edge Beta/Dev/Canary

Steps To Reproduce

N/A

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Relevant Assets

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions