-
Notifications
You must be signed in to change notification settings - Fork 80
Added new kb article tooltip-show-on-disabled-element #2607
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
Merged
Tsvetomir-Hr
merged 2 commits into
master
from
new-kb-tooltip-show-on-disabled-element-de63f4dce202465b9543de8480d6667f
Dec 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| title: Displaying Tooltip on Disabled HTML Element | ||
| description: Learn how to show a tooltip for a disabled element by wrapping it with an HTML element in Blazor applications. | ||
Tsvetomir-Hr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type: how-to | ||
| page_title: How to Displaying Tooltip on Disabled HTML Element | ||
Tsvetomir-Hr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| slug: tooltip-kb-disabled-element | ||
| tags: tooltip, disabled element | ||
| res_type: kb | ||
| ticketid: 1665023 | ||
| --- | ||
|
|
||
| ## Environment | ||
|
|
||
| <table> | ||
| <tbody> | ||
| <tr> | ||
| <td>Product</td> | ||
| <td>Tooltip for Blazor</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| ## Description | ||
|
|
||
| When an HTML element is disabled, providing additional information via a Tooltip can be challenging since disabled elements do not respond to mouse events. Hence, the Tooltip cannot detect when the user hovers over a disabled element. | ||
|
|
||
| This knowledge base article also answers the following questions: | ||
| - How can I display a tooltip over a disabled HTML element in Blazor? | ||
| - How to display a tooltip over a disabled button? | ||
| - What is the workaround for showing tooltips on disabled elements in Blazor? | ||
| - Can a tooltip be associated with a disabled element in Blazor applications? | ||
|
|
||
| ## Solution | ||
|
|
||
| To display a Tooltip for a disabled button, wrap the disabled button within another HTML element, like a `<div>`, and then set the Tooltip to target this wrapper element. This approach allows the Tooltip to be activated when the user hovers over the area covering the disabled button. | ||
Tsvetomir-Hr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Here's an example demonstrating how to implement this solution: | ||
|
|
||
| CSHTML```` | ||
| <div class="disabled-button" style="width: fit-content;"> | ||
| <TelerikButton Enabled="false">Hover me</TelerikButton> | ||
| </div> | ||
|
|
||
| <TelerikTooltip TargetSelector=".disabled-button"> | ||
| <Template> | ||
| @{ | ||
| <h6> | ||
| <strong>Disabled button</strong> | ||
| </h6> | ||
| } | ||
| </Template> | ||
| </TelerikTooltip> | ||
| ```` | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Tooltip Component Overview]({%slug tooltip-overview%}) | ||
| - [Button Component Overview]({%slug components/button/overview%}) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.