flex 盒中的 bound='parent' 选项
作者: javaxiu创建于 2016年12月28日更新于 2026年9月27日
标签bugready-for-human
在这种情况下:<div style="display: flex;flex-direction: 'column'; width: 800px; height: 600px"> <div style='width: 300px' id='leftside'></div> <div style='flex:1'> <Draggble bounds='parent'><div>bound drag</div></Draggble> </div> </div>
bound 选项似乎可以很好地锁定可拖拽的 div 在 800*600 面积中,但 offset left 被忽略了。我的意思是,可拖拽的 div 不应该能够拖动到 x=0px,而应该是 300px。
内容来源: react-grid-layout/react-draggable