-
-
Notifications
You must be signed in to change notification settings - Fork 49.7k
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
Fixed collapsible sider menu #6997
Comments
@mkermani144 |
@marswong |
the style of |
@marswong I am facing the same issue. I have uploaded a video here. https://youtu.be/nZ8Tuswd7JI . When you make a fixed sidebar collapsible, the responsive-ness of the Content disappears. As you can see in the video, the interface looks lagging and not smooth, at all. @mkermani144 How did you worked around this one? |
@wzard As I said, I manage |
@mkermani144 When I am making the position: "fixed" for the Sider, the Inline Icons on collapse also doesn't work. Can you share a codepen demo of how you are making it work, please? |
@Xemnoras As I said earlier, I manage |
So are there any plans to fix this behavior? |
I think having the side menu to be able to have a fixed position and at the same time being able to collapse would be great and I really look forward for this feature. It may not be implemented but it would be great to have examples in the doc to show to do that. |
I'm hoping for nice solution to this, I would love to manage as little state as possible in my application. |
I did the same thing, fixed it by creating a setMarginLeftHandler in the parent Layout and passing that as a prop to a wrapped Sider. Then onCollapse (on the Sider), call props.setMarginLeftHandler to fix up the margins of the parent. In my case I used a HOC recompose component so I could still use functional React components but if would of course work with standard stateful react components too. Regardless, definitely a tad awkward. |
You can see Ant Design Pro width fixed sider: https://preview.pro.ant.design/dashboard/analysis?fixSiderbar=1 |
I did it simply by adding some css rules! 👍 |
by changing Sider style to |
You legend |
Thanks buddy, its worked for me |
This works great. But still, there is a problem. After adding custom CSS, sidebar trigger isn't showing up and I can't use the sidebar as there is nothing to trigger the sidebar to open or close |
Thanks. U r awesome))) |
How could we move the collapsible sidebar to the top left instead of now having it at the left bottom? |
if you hover over the menu items while the sidebar's collapsed, and scroll the page, the tooltip of the hovered menu item will slide as well. |
What problem does this feature solve?
Although an example of a fixed Sider is provided in the documentation (#5660), the trick of making Sider position fixed does not work easily if the Sider has collapsible menu. The developer should manage left (or right) property of the content by hand, and change it on collapse. Is there any better approach to do it, or is it intended to add a feature facilitating this?
What does the proposed API look like?
For example,
Sider
parent (which is aLayout
) could have acollapsibleFixedSider
, by setting which theSider
position becomes fixed, and its sibling (probably aLayout
orLayout.Content
)margin
property updates is handled inside of the library itself, adding a layer of abstraction to the developer.The text was updated successfully, but these errors were encountered: