Description
In UserDropdown.tsx, the DropdownMenuContent uses forceMount (line 66), which keeps the dropdown DOM mounted even when closed. This adds unnecessary nodes to the DOM tree at all times.
File to change
surfsense_web/components/UserDropdown.tsx (line 66)
Current code
<DropdownMenuContent className="w-44 md:w-56" align="end" forceMount>
What to do
<DropdownMenuContent className="w-44 md:w-56" align="end">
Simply remove forceMount. Radix will mount the content only when the dropdown is open (the default behavior).
Note: If forceMount was added for animation purposes, use Radix's data-state CSS attributes for open/close animations instead.
Acceptance criteria
forceMount is removed
- Dropdown still opens/closes correctly
- Dropdown content is not in the DOM when closed
Description
In
UserDropdown.tsx, theDropdownMenuContentusesforceMount(line 66), which keeps the dropdown DOM mounted even when closed. This adds unnecessary nodes to the DOM tree at all times.File to change
surfsense_web/components/UserDropdown.tsx(line 66)Current code
What to do
Simply remove
forceMount. Radix will mount the content only when the dropdown is open (the default behavior).Note: If
forceMountwas added for animation purposes, use Radix'sdata-stateCSS attributes for open/close animations instead.Acceptance criteria
forceMountis removed