ticlo / rc-dock

Dock Layout for React Component

Home Page:https://ticlo.github.io/rc-dock/examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PanelLock with controlled layout

rickiezz opened this issue · comments

commented

Hello,

Ive been trying to get a panel to stay when all the tabs are closed in controlled layout, but so far ive had no luck with it. Ive defined minHeight, minWidth, flexHeight, flexWidth, but none of them seem to really do anything.

I hope you can let me know what I am not seeing to make it work.

Thanks in advance!

commented

Hello, got the same question and resolved it using the afterPanelLoaded props of DockLayout, customize the PanelData in this method.
Example :

const afterPanelLoaded = (savedPanel, loadedPanel) => {
    if (savedPanel.id === 'your-panel-id')
        loadedPanel.panelLock = {}
};
commented

Yes, that worked!

Thanks for the help.