caplin / FlexLayout

Docking Layout Manager for React
MIT License
919 stars 173 forks source link

Maximizing tabset through `updateNodeAttributes` doesn't work #395

Closed Wain-PC closed 1 year ago

Wain-PC commented 1 year ago

Describe the bug

I am trying to control tabset maximize state programmatically. Using Actions.maximizeToggle works fine except it's toggle only, so it's not possible to control exact state, only switch it. I've tried the following approach then:

Actions.updateNodeAttributest(tabsetId, { maximized: true });

However, this one does nothing. The value seems to get applied but UI doesn't change and tabset is not maximized.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Create a simple layout with tabset with 1 tab.
  2. Get ID of the tabset
  3. Run Actions.updateNodeAttributest(tabsetId, { maximized: true })

Expected behavior

  1. Tabset is maximized

Operating System

Linux

Browser Type?

Google Chrome

Browser Version

114.0

Screenshots or Videos

screenshot is not possible

Additional context

No response

Wain-PC commented 1 year ago

After some further research it seems that this is not a bug since maximized is not an attribute of ITabSetAttributes, but rather a property of IJsonTabSetNode.

However, it still seems impossible to fully control maximized state using only maximizeToggle action. I think it needs an optional boolean argument.