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

Allow collapsible sider to be used in fixed position #18426

Open
1 task done
SarhadSalam opened this issue Aug 22, 2019 · 1 comment
Open
1 task done

Allow collapsible sider to be used in fixed position #18426

SarhadSalam opened this issue Aug 22, 2019 · 1 comment
Assignees
Labels

Comments

@SarhadSalam
Copy link

SarhadSalam commented Aug 22, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

Presently, in Layout Sider, the collapsible sider is in position:relative by default. To use a fixed sider, we must use a non-collapsible design because when position is set as fixed for the sider, the content of the Layout is manually set to 200px to the right.

Collapsible navigation is a great tool, but cannot be used in fixed mode and this causes multiple problem:

  1. When we set 200px for margin-right, we have to manually change this value in the content css which is not good design. It's not good design because, let's say we have layout A, B, C. A is the parent component containing B and C. B is the sider, and C is the content. If we do not have redux setup (for simple projects), communication of this 200px/collapse status/animation of content sliding becomes a tedious task.

What does the proposed API look like?

The solution is really simple. For the first children inside a sider, there is a div with the class: .ant-layout-sider-children.

I was thinking, we check if(collapsible && position==fixed), then we add the following css rules to the above-mentioned class:

.ant-layout-sider-children {
     width: inherit;
     position: fixed;
}

This fixes all the problem, and we can use fixed collapsible navigation with a really easy fix.

I am willing to submit a PR to fix this, I just need to be guided in the right direction.

Thanks in advance!

@Enigama
Copy link
Contributor

Enigama commented May 30, 2022

Is there any changes?

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

No branches or pull requests

4 participants