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

MudSplitter questions #489

Open
Cybrosys opened this issue Dec 17, 2024 · 3 comments
Open

MudSplitter questions #489

Cybrosys opened this issue Dec 17, 2024 · 3 comments

Comments

@Cybrosys
Copy link

Hello,

Maybe this has been asked and answered before, but I was not able to find those answers.

I'm trying to achieve a sort of file explorer type layout behavior (one content is locked while the rest fills the space) and I was wondering if it's possible with MudSplitter or not.

What I'm trying to achieve is the following:

  • The StartContent has a starting/initial size in pixels (or some other unit) and the EndContent fills the remaining area.
  • The StartContent size should remain the same if the browser window is resized.
  • The user can use the splitter to change the size/dimension.
  • The Start- and EndContent should have a minimum size set which prevents the splitter bar from moving all the way to the left or right.

The only property I could find to set an initial size was Dimension, however that is percentage based and thus means different things depending on the browser window.

So, is it possible to set initial pixel sizes or placement of the divider, and lock the StartContent so it doesn't resize when the browser window changes in size etc.?

@mckaragoz
Copy link
Contributor

Nice idea. But splitter controlled with a slider, I think it's not currently possible to set pixels. But you can use resize observer and set StartContent percentage manually when user resize the screen.

Setting min and max value is possible i think. We already added min and max for the MudRangeSlider.

@Cybrosys
Copy link
Author

Cybrosys commented Dec 20, 2024

I'm guessing that what I'm trying to do could be seen as an anti-pattern or anti-design as it is the opposite of being flexible/responsive with the sizes, sort of the whole point of flexbox.

Regardless, I was able to find a library that had implemented this and if anyone is looking for the same and stumbles on this post then I'm using this:
https://github.com/jsakamoto/Toolbelt.Blazor.SplitContainer

It allows me to set a fixed size for one of the containers (as well as minimum etc.) and let the rest adapt/fill the remaining spaces.

It would however be nice to have the same features on MudSplitter if anyone has the knowledge or experience to be able add the support. I am fairly new with Blazor so I feel it's safer to try and use what is out there to start with.

@mckaragoz
Copy link
Contributor

The main idea of MudSplitter is make a non-js and smooth solution. We can think what we can do about pixel sizing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants