caplin / FlexLayout

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

Added `action` argument to `onModelChange` prop function call #366

Closed Wain-PC closed 1 year ago

Wain-PC commented 1 year ago

This is similar to #64 , which has been reverted for an unknown reason.

It's a non-breaking change that adds a 2nd action argument to onModelChange prop function. It can help the user determine the source of the change, e.g. for filtering out layout changes that are produced by certain action type.

Example use case: I'd like to store layout in localStorage after changes, but ignore changes produces by the user switching between tabs and tabsets since they don't alter page layout.