Thank you for providing the new Splitter component. It looks very useful for building resizable layouts. I would like to request a way to access and control the collapsed state of each pane as a public state.
Proposed API
I would like to request public APIs for the expansion state of Splitter panes.
Properties
- start-expansion
- end-expansion
These properties would allow applications to explicitly set and read whether a pane is expanded or collapsed.
Event
This event would be fired whenever a user collapses or expands a pane. Applications could use this event to save the user's preferred layout, for example in localStorage, and restore it later.
Why this is needed
Currently, the Splitter provides the toggle() method, but I cannot find a way to read the current expansion state of a pane.
Because users can also collapse and expand panes by direct interaction, application code cannot reliably know whether toggle() will collapse or expand a pane.
As a result, applications cannot make decisions based on the current pane state.
Public expansion state properties would allow applications to inspect the current state and control pane behavior in a predictable way.
Scenario 1
I want to implement behavior such as the following.
"If the pane is already expanded, do nothing. If the pane is collapsed, expand it."
At the moment, this is difficult because the current expansion state is not available through a public API.
Using toggle() is not sufficient because the application cannot know in advance whether the pane will be expanded or collapsed.
Scenario 2
I want to persist the user's preferred layout and restore it when they revisit the page.
For example, an application may save whether a pane is expanded or collapsed in localStorage. When the page is opened again, the application should restore the same state automatically.
This requires both a way to read and set the current expansion state and an event that notifies the application when the user changes that state.
Thank you for considering this improvement.
Thank you for providing the new Splitter component. It looks very useful for building resizable layouts. I would like to request a way to access and control the collapsed state of each pane as a public state.
Proposed API
I would like to request public APIs for the expansion state of Splitter panes.
Properties
These properties would allow applications to explicitly set and read whether a pane is expanded or collapsed.
Event
This event would be fired whenever a user collapses or expands a pane. Applications could use this event to save the user's preferred layout, for example in localStorage, and restore it later.
Why this is needed
Currently, the Splitter provides the toggle() method, but I cannot find a way to read the current expansion state of a pane.
Because users can also collapse and expand panes by direct interaction, application code cannot reliably know whether toggle() will collapse or expand a pane.
As a result, applications cannot make decisions based on the current pane state.
Public expansion state properties would allow applications to inspect the current state and control pane behavior in a predictable way.
Scenario 1
I want to implement behavior such as the following.
"If the pane is already expanded, do nothing. If the pane is collapsed, expand it."
At the moment, this is difficult because the current expansion state is not available through a public API.
Using toggle() is not sufficient because the application cannot know in advance whether the pane will be expanded or collapsed.
Scenario 2
I want to persist the user's preferred layout and restore it when they revisit the page.
For example, an application may save whether a pane is expanded or collapsed in localStorage. When the page is opened again, the application should restore the same state automatically.
This requires both a way to read and set the current expansion state and an event that notifies the application when the user changes that state.
Thank you for considering this improvement.