Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add posibility to reset size to it's initial state #330

Open
MerlijnKerklaan opened this issue Nov 28, 2022 · 3 comments
Open

Add posibility to reset size to it's initial state #330

MerlijnKerklaan opened this issue Nov 28, 2022 · 3 comments
Labels
enhancement waiting-for-reply Waiting for reply or confirmation of user creating the issue.

Comments

@MerlijnKerklaan
Copy link

I could not find a way to reset the splitter to it's initial state. I think it would make a great addition to the angular split component to be able to reset it to it's initial state.

@beeman
Copy link
Collaborator

beeman commented Nov 28, 2022

Hey there @MerlijnKerklaan - feel free to create a pull request that includes tests and I will look at merging it.

@Harpush
Copy link
Collaborator

Harpush commented Sep 2, 2023

The main issue here is what is initial state? If user moved the gutter and you update your size property - does it mean the initial state changed? If for example a new size came from outside without user interaction - does it mean the initial state changed?
I am not sure this is a feature that can be integrated as it sounds very use case specific. More like something the component using the split should handle by changing the size to the so called initial size when appropriate.

@beeman your thoughts on the matter?

@Harpush Harpush added enhancement waiting-for-reply Waiting for reply or confirmation of user creating the issue. labels Sep 2, 2023
@beeman
Copy link
Collaborator

beeman commented Sep 2, 2023

The main issue here is what is initial state? If user moved the gutter and you update your size property - does it mean the initial state changed? If for example a new size came from outside without user interaction - does it mean the initial state changed? I am not sure this is a feature that can be integrated as it sounds very use case specific. More like something the component using the split should handle by changing the size to the so called initial size when appropriate.

@beeman your thoughts on the matter?

I think it's not something we should add to the main library, it seems to be relatively simple to implement, and doing it your own way allows you to pick where you want to store this (state/local storage/database, etc).

As inspiration, you can look at this example and tweak it so you keep the 'initial' state and allow the user to restore that.

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement waiting-for-reply Waiting for reply or confirmation of user creating the issue.
Projects
None yet
Development

No branches or pull requests

3 participants