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

[split-view] track widths as percentages #388

Open
MikeMatusz opened this issue Sep 26, 2023 · 0 comments
Open

[split-view] track widths as percentages #388

MikeMatusz opened this issue Sep 26, 2023 · 0 comments

Comments

@MikeMatusz
Copy link
Contributor

Describe the feature:
Currently, you can specify size as a percentage, but it gets converted to a pixel width and when resizing panels, the width is always set in pixels. If the window is resized, for example, instead of keeping the same relative size of the panels, the absolute width of the resizable panel in pixels is maintained, and any non-resizable panels are the only ones affected. In some cases, this might be desirable, but in many it is not.

I'm proposing, that if the size attribute is specified as a percentage, it should continue to be tracked as a percentage. When resized, the pixel size would be converted into a percentage of the parent width or height depending on orientation, and the percentage value would be used for layout instead of pixels.

Describe any alternatives you've considered:
My current workaround involves handling the forge-split-view-panel-resize event, and updating the size attribute to the new calculated percentage, then calling the internal panel._foundation._applySize() method on window resize events.

Additional context:

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

No branches or pull requests

2 participants