drawer icon indicating copy to clipboard operation
drawer copied to clipboard

Initialize Drawer Within Element

Open junbinku opened this issue 6 years ago • 9 comments

Hi, It is possible to have a drawer initialising only inside an element for example, drawer inside a div tag.

Here is some sample:

https://codesandbox.io/s/r5x6qnml6p

junbinku avatar Aug 31 '18 07:08 junbinku

getContainer={null}

jljsj33 avatar Aug 31 '18 08:08 jljsj33

This didn't work for me:


<div className='containerGrid'> 
  <Drawer getContainer={null} ><div>test</div></Drawer>
</div>
.containerGrid {
  grid-row-start: 3;
  grid-row-end: 3;
  grid-column-start: 1;
  grid-column-end: 3;
}

junbinku avatar Aug 31 '18 08:08 junbinku

?????????? image

jljsj33 avatar Aug 31 '18 09:08 jljsj33

Sorry thats the sample of what I am trying to achieve.

junbinku avatar Aug 31 '18 09:08 junbinku

I don't understand what you are saying.

You're going to be render in div. Or just putting Drawer on div, render in body?

render in div:

<div className='containerGrid'> 
  <Drawer getContainer = {null}><div>test</div></Drawer>
</div>

https://codesandbox.io/s/92l9541xrw

render in body

Your sample is in this way.

<div className='containerGrid'> 
  <Drawer ><div>test</div></Drawer>
</div>

https://codesandbox.io/s/1zoo8q0lj4

jljsj33 avatar Aug 31 '18 10:08 jljsj33

翻译真累。。。

jljsj33 avatar Aug 31 '18 10:08 jljsj33

Doing the following worked for me

<div style={{ transform: 'translate(0)' }}> 
  <Drawer ><div>test</div></Drawer>
</div>

ghost avatar Feb 25 '19 07:02 ghost

This example https://codesandbox.io/s/92l9541xrw does not work correctly with version 4.4.3. How can I make it work correctly?

I want to do the same as this functionality (https://drawer-react-component.vercel.app/demo/no-mask), but inside a div.

Alejandroid17 avatar Mar 11 '22 20:03 Alejandroid17

This example https://codesandbox.io/s/92l9541xrw does not work correctly with version 4.4.3. How can I make it work correctly?

I want to do the same as this functionality (https://drawer-react-component.vercel.app/demo/no-mask), but inside a div.

I have built this example https://stackblitz.com/edit/react-krx3ez?file=src/App.js, which has been useful, but I would like the content of the body is not under the drawer.

Alejandroid17 avatar Mar 14 '22 18:03 Alejandroid17