-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Disabled element won't show tooltip #304
Comments
Same issue here, but it only occurs with (disabled) buttons, not all elements.
|
I was bit by the same issue. Good idea on the workaround |
+1, guess i'm doing the workaround 🤕 |
The workaround makes the tooltip display, but, for me, it does not follow the mouse. |
Hm, don't really like the wrapping workaround, as it can mess up things like menu items etc, that rely on a certain DOM structure. I think a very common scenario is to want to show a tool-tip if a button is disabled, to explain to the user why it's disabled. |
Keep the button inside the
|
can't stress this more. |
I haven't full tested it yet, but I have a situation where wrapping in ... it makes tooltip appear, but don't disappear. |
+1 |
If you have another tag in disabled button you can set tooltip on it as well. |
The workaround that worked best for me is to put the span inside the button: <button disabled={true}>
<span data-tip="Lorem ipsum" data-tip-disable={false}>
Click
</span>
</button> |
That worked great, thanks! I also replaced 'span' with 'div', since span caused the tooltip to be visible only when hovering over the text, not the whole button. |
^ you have to style the span though to be full height of the button, otherwise the tip will trigger only over the text. |
i've been bitten, too, and was hoping for a true solution, but... looks like this is gonna be hard to solve without introducing some higher-level code (which i'm not sure is desired for this library); the issue stems from the native behavior of disabled elements (see this demo for an illustration of this behavior). details: the way that react-tooltip responds to user interaction is relying on native dom event binding (namely, |
also, here's my current take for a workaround (source):
this implementation has an obvious limitation (on top of the structural limitations mentioned in earlier comments); it assumes all example usage:
it can also be used for its declarative abstraction-level of form-control components, that is - we can include CSS rules that are common to buttons, inputs, selects etc. (ever found yourself constantly repeating stuff like |
Works great, thanks :) |
updating rc-tooltip to latest version made it work |
The tooltip won't show if button is disabled.
The text was updated successfully, but these errors were encountered: