Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way or prop to disable Tooltip #244

Open
juanjdlt opened this issue May 26, 2021 · 0 comments
Open

Provide a way or prop to disable Tooltip #244

juanjdlt opened this issue May 26, 2021 · 0 comments

Comments

@juanjdlt
Copy link

Hello and thanks a lot for crafting Smelte!

I have this case where I attached a Tooltip to a button to tell the user that something is missing in order to continue.
So once the user completes some stuff I would like stop showing the tooltip.

After trying and digging around some options I decided to achieve the mentioned issue by setting the .tooltip element , that the component inject , as display:none when the user completes some stuff.

I think is a kind of workaround. It will be nice to pass some prop the the Tooltip component to dynamically stop/disable the ".tooltip" element to be injected.

Snippet example:

<div class:hide-tooltip={someFlag}>
      <Tooltip>
        <div slot="activator">
          <Button contained color="primary">
            Button Label
          </Button>
        </div>
        <span class="text-sm">Tooltip message</span>
     </Tooltip>
</div>

<style>
:global(.hide-tooltip .tooltip) {
    display: none;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant