react-grid-layout / react-draggable

React draggable component
MIT License
9.01k stars 1.02k forks source link

Bounds worked not as expected #672

Open AhmadYoussef opened 2 years ago

AhmadYoussef commented 2 years ago

Problem Report

I've tried putting two draggable elements inside each other and bounds them to the mainContainer but unfortunately, it didn't work as expected and I'd like to know if is this a bug or if am I doing it wrong?

example

      <Draggable {...dragHandlers} bounds={"#MainContainer"}>
        <div className="box">
          <div>I</div>
          <Draggable {...dragHandlers} bounds={"#MainContainer"}>
            <strong id="anywhere" style={{ display: "inline-block" }}>
              Move me Anywhere
            </strong>
          </Draggable>
          <div> be dragged anywhere</div>
        </div>
      </Draggable>
    </div>
cwaj400 commented 1 year ago

Hi there! What were you expecting to happen? Thanks,