RadzenSidebar messes with Blazor ContextMenu #1516

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

Originally created by @friis-kraas-trinidat on GitHub (Dec 4, 2024).

Describe the bug
Putting a BlazorContextMenu.ContextMenu as a child component of a RadzenSidebar, the ContextMenu renders at a wrong position, because the "transform: translate(0px)" style that is automatically added to the sidebar div for smoother collapse/expand transitions messes with the coordinate system used to position a ContextMenu with left and top style attributes

To Reproduce
Steps to reproduce the behavior:

  1. Create a Layout with a RadzenSidebar
  2. Put a ContextMenu and some ContextMenuTrigger as a child component inside the RadzenSidebar
  3. Rightclick the Trigger, the menu will open at an offset position from the mouse

Expected behavior
Any component that uses left/right/top/bottom styles for positioning should be unaffected by Radzen components like RadzenSidebar

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: 133.0

Additional context
There is a workaround by adding a "transform: none !important" to the sidebar in a non-collapsed state, but as this affects components multiple levels deep, it is not obvious this transform causes the issue. If dropping the transform style is not possible, this effect should at least be mentioned somewhere in documentation.

Originally created by @friis-kraas-trinidat on GitHub (Dec 4, 2024). **Describe the bug** Putting a BlazorContextMenu.ContextMenu as a child component of a RadzenSidebar, the ContextMenu renders at a wrong position, because the "transform: translate(0px)" style that is automatically added to the sidebar div for smoother collapse/expand transitions messes with the coordinate system used to position a ContextMenu with left and top style attributes **To Reproduce** Steps to reproduce the behavior: 1. Create a Layout with a RadzenSidebar 2. Put a ContextMenu and some ContextMenuTrigger as a child component inside the RadzenSidebar 3. Rightclick the Trigger, the menu will open at an offset position from the mouse **Expected behavior** Any component that uses left/right/top/bottom styles for positioning should be unaffected by Radzen components like RadzenSidebar **Desktop (please complete the following information):** - OS: Windows - Browser: Firefox - Version: 133.0 **Additional context** There is a workaround by adding a "transform: none !important" to the sidebar in a non-collapsed state, but as this affects components multiple levels deep, it is not obvious this transform causes the issue. If dropping the transform style is not possible, this effect should at least be mentioned somewhere in documentation.
Author
Owner

@akorchev commented on GitHub (Dec 5, 2024):

I don't think we can remove this transform without breaking existing apps. Have you tried with the Radzen.Blazor context menu? It should position correctly regardless of transforms.

@akorchev commented on GitHub (Dec 5, 2024): I don't think we can remove this transform without breaking existing apps. Have you tried with the Radzen.Blazor context menu? It should position correctly regardless of transforms.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1516