-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Tooltip: Tooltip not showing when p-button is disabled #13797
Comments
Tooltip shouldn't be triggered when the button is disabled, this is not a bug. It's how it should be since the disabled button cannot receive any events. It's by design and it should stay as it is. Closing the issue since there is not a bug, enhancement or feature request. |
As a workaround, you can add |
Hmm i often (actually: always) want to explain to the user, why a button is disabled. Better not changing the default behaviour, but maybe like:
maybe with a better name
pointer-events: auto workaround works like a charm, thx! so my Side note: same behaviour for simple html "title" attribute, not only pTooltip |
Providing a tooltip to the user and running the action when clicking the message are two different things, and it may be, as @fsomme2s indicated, that you want to explain why it is disabled. Providing at least an opt-in class or directive for any component that behaves this way would be appropriate. Seems to me, that should have been the default. Thanks to @Adrii77 for the workaround. |
The workaround mentioned here technically works, but it also re-enables the click event for the disabled buttons... which was very undesirable behaviour. I'd argue that a button being disabled is probably the most likely time that you'd want to have a tooltip, as mentioned already... |
I agree with @fsomme2s and @mconner that having this as an opt-in feature could be really useful, as I encountered the same problem while trying to show my users WHY the button is disabled (and the same issue on the tieredMenu btw). Would really be appreciated if the team can re-think this decision since it would be very useful to show tooltips when buttons are disabled. |
As mentioned already, it would be nice to have this feature to explain why the button is disabled, at least an opt-in class... |
I encountered the same issue, one of the most common uses of tooltips is to explain to users why the button is disabled, I think this issue should be reopened. |
Same opinion than each other comments below. Pushing information through tooltip when button is disabled is such a common feature. It's sad to see that's not rendered on primeNg buttons by design. |
It is highly desirable to have the tooltip show when the button is disabled to indicate to the user why the button is disabled. We are pretty sure it worked this way in earlier versions as we just discovered it no longer does. Please reopen. |
same |
how to notify user why the button is disabled then? |
throwing a div around the button with a tool tip is an easy way to get around this albeit very ugly to read. |
Just stumbled on this issue looking for the same disabled button reason use case. |
I wouldn't expect to see it resolved anytime soon honestly. Considering this is expected according to the first comment. |
Even if this is not a bug and is working as intended, you can implement the required behaviour by wrapping the button with a span (or a div as suggested in other comments) and by providing the tooltip directive there. example:
|
I honestly think this is a conceptual flaw and you should reevaluate that behavior. It's one of the most infuriating things in UIs when they disable stuff without explaining why, and you are inviting this behavior by making it pretty difficult to do it right. |
Describe the bug
Tooltip not showing when p-button is disabled.
Environment
Primeng 16.4.1
Angular 16.2.0
Reproducer
https://stackblitz.com/edit/ejvvqt?file=src%2Fapp%2Fdemo%2Ftooltip-basic-demo.html
Angular version
16.2.0
PrimeNG version
16.4.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.16.1
Browser(s)
Chrome 117
Steps to reproduce the behavior
Expected behavior
the tooltip appears when hovering over the disabled button.
The text was updated successfully, but these errors were encountered: