TooltipService.Open CssClass attribute is applied to wrong div. #482

Closed
opened 2026-01-29 17:38:04 +00:00 by claunia · 1 comment
Owner

Originally created by @FilipVanBouwel on GitHub (Jul 26, 2022).

image

I tried to apply a css class to my tooltips so that the tooltip background has the same color as the button it's applied to. But as you can see in the picture below, the css class (bg-danger) is applied to the top div instead of to the div just below it. When using the TooltipOptions.Style property, it does work as expected.

image

I expected both Style and CssClass properties to be applied to the same div.

When manually fixing it using the browser debug tools, it does look like I exptected it too.

image
image

Originally created by @FilipVanBouwel on GitHub (Jul 26, 2022). ![image](https://user-images.githubusercontent.com/46245159/181098294-12cbb2c4-d767-49a6-aa17-7c3789bc07e7.png) I tried to apply a css class to my tooltips so that the tooltip background has the same color as the button it's applied to. But as you can see in the picture below, the css class (bg-danger) is applied to the top div instead of to the div just below it. When using the TooltipOptions.Style property, it does work as expected. ![image](https://user-images.githubusercontent.com/46245159/181097116-65000a24-e5af-43af-b69a-8488b7e9648b.png) I expected both Style and CssClass properties to be applied to the same div. When manually fixing it using the browser debug tools, it does look like I exptected it too. ![image](https://user-images.githubusercontent.com/46245159/181098695-4d1514e6-35ce-425b-a3c7-ea4cd9de5221.png) ![image](https://user-images.githubusercontent.com/46245159/181098461-faebee68-921d-4399-87d5-61631740f455.png)
Author
Owner

@akorchev commented on GitHub (Jul 27, 2022):

Hi @FilipVanBouwel,

By default all Radzen Blazor components apply the CSS class to the outermost HTML element. This allows full control. You can update your CSS to target the required element:

.bg-danger .rz-tooltip-content {
   background: red;
}
@akorchev commented on GitHub (Jul 27, 2022): Hi @FilipVanBouwel, By default all Radzen Blazor components apply the CSS class to the outermost HTML element. This allows full control. You can update your CSS to target the required element: ``` .bg-danger .rz-tooltip-content { background: red; } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#482