how to implement sidebar in <div>
See original GitHub issueVersion
2.13.1
Environment
Windows 10 x64, Chrom 61, react 15.4, react-router 4
Reproduction link
https://codepen.io/anon/pen/XeWPog?editors=001
Steps to reproduce
Create CustomSider
const CustomSider = ({sensors, dispatch}) => {
// console.log({sensors.sensors});
return (
<Sider style={{background: '#fff', borderRight: 'solid', borderColor:'#ddd', borderWidth:'5px'}}>
<Menu mode="inline" theme="light">
<Menu.Item key="dev1">Device 1</Menu.Item>
<Menu.Item key="dev2">Device 2</Menu.Item>
<Menu.Item key="dev3">Device 3</Menu.Item>
</Menu>
</Sider>
);
}
Then add CustomSider.__ANT_LAYOUT_SIDER = true
.
For the DOMRender, add
ReactDOM.render(
<Layout>
<div><CustomSider></CustomSider></div>
<Content>Content</Content>
</Layout>
, mountNode);
Thatās all.
What is expected?
Content to the right of Sider
What is actually happening?
Content under Sider
This happened when I want to put CustomSider in my <Route/> to hide the CustomSider in some routes.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
CSS Sidebars: A Beginner's Guide - HubSpot Blog
The simplest way to implement a sidebar is with a static sidebar element (colored blue below) that spans the height of the page...
Read more >How To Create a Responsive Sidebar - W3Schools
Learn how to create a responsive side navigation menu with CSS. ... This example use media queries to transform the sidebar to a...
Read more >Sidebar Menu Using HTML and CSS - DEV Community ā ā
Step 1: Create a basic html structure to create sidebars Ā· Step 2: Design the background using css code Ā· Step 3: Add...
Read more >How make sidebar slide inside of a div and not the body?
Wrap the whole ul-menu called "side-menu" in a div. Second step: ... Now style the wrapper div of the ul to your own...
Read more >Responsive Sidebar Component in HTML, CSS and JavaScript
Use the data-static-class="{class}" attribute on the .sidebar element if you want to add a list of classes to the sidebar when it's in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Of course this is not that important but i would be happier if it just worked. I just lost some time trying to figure out why it doesnāt work. š
Itās not ideal but i was thinking of doing something like this
Hi @nikogu,
I just had the same issue and digged into ant designās source code. I found following code in here:
It could be easily implemented using contexts, is this by design ? If so could you explain your reasoning behind this behaviour ?