Skip to content

[Bug] ActionButton: Dropdown menu misaligned when clicking dropdown arrow #1809

Description

@MAYANKSHARMA01010

Current Behavior

In the ActionButton component, clicking the dropdown arrow opens the menu misaligned and shifted to the right.

This happens because the Popper anchors dynamically to event.currentTarget (the small arrow button) instead of the entire ButtonGroup.

Expected Behavior

The dropdown menu should always open at a consistent, aligned position under the ButtonGroup, whether the user clicks the primary button or the dropdown arrow button.

Root Cause

  1. anchorEl was set to event.currentTarget inside handleToggle, which points only to the arrow button on the right edge.
  2. ButtonGroup was missing a ref={anchorRef}.

Related Issue

Environment

  • Component: @sistent/sistent (src/custom/ActionButton/ActionButton.tsx)
  • Consumers: Kanvas (MeshMap), Meshery UI

Metadata

Metadata

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions