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

UiButton tooltip when disabled #469

Open
EmilMoe opened this issue Sep 28, 2019 · 5 comments
Open

UiButton tooltip when disabled #469

EmilMoe opened this issue Sep 28, 2019 · 5 comments

Comments

@EmilMoe
Copy link
Contributor

EmilMoe commented Sep 28, 2019

I noticed that the tooltip is only working when the button is not disabled? What's the reason behind this?

My save button is disabled until the form is valid, but I would like to display a tooltip saying something about this.

If there's a good reason not to have the tooltip, I don't want to propose a PR

@hyvyys
Copy link
Contributor

hyvyys commented Oct 18, 2019

The tooltip doesn't show up because the root node of UiButton is a <button> (a poor choice imho), and a disabled button doesn't get any mouse events.

The workaround is to wrap your UiButton in another element and let that be the tooltip toggle. But I'm having issues with this when using tooltip with v-if...

@sysebert
Copy link

sysebert commented Mar 19, 2020

you can use a title on it which should do what you want?

<button title="I still work when disabled" disabled>Button Text</button>

https://jsbin.com/riwulemehe/edit?html,output

@EmilMoe
Copy link
Contributor Author

EmilMoe commented Mar 19, 2020

That's not really what I wanted as I wanted to keep the UI

@sysebert
Copy link

I was just using "button" as a placeholder for whatever you ended up naming your component.

import UiButton from 'keen-ui/lib/UiButton';

Vue.component('ui-button', UiButton);
<template>
  <ui-button
    color="primary"
    title="I still work when disabled"
    type="primary"
    disabled>
    Button Text
  </ui-button>
</template>

@hyvyys
Copy link
Contributor

hyvyys commented Mar 20, 2020 via email

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

3 participants