Skip to content

[Toolbar] Changes in button states do not propagate to the menu items #2671

@Windigo

Description

@Windigo

Provide a general summary of the issue here

If the disabled state of an <sl-button> in an <sl-tool-bar> changes, the ToolBarItemButton definition is not updated. This causes the state of the button to not match the state of the menu item.

🤔 Expected Behavior?

The state should match

😯 Current Behavior

It doesn't match

💁 Possible Solution

Perhaps use an MutationObserver to observe the disabled state of the buttons and update the toolbar item definitions.

🖥️ Steps to Reproduce

https://github.com/sl-design-system/components/tree/bug/storybook-grid-toolbar-state

  1. http://localhost:6006/?path=/story/grid-selection--state-demo
  2. Observe clicking the "Toggle test1" will change the disabled state of the button
  3. Observe when making the window smaller and the buttons disappearing into the overflow menu button that the button state no longer matches the original button

👤 Your name

Menno Homan

🧢 Your product/team

Team Us Heit

🎨 Your Theme(s)

Magister

Metadata

Metadata

Assignees

Type

Projects

Status

✈️ Released

Relationships

None yet

Development

No branches or pull requests

Issue actions