Draggable react bootstrap Modal moves the browser scroll bar

Open
#321 2 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react
Domain
frontend

Research direction

Start by reproducing the example with react-bootstrap Modal wrapped in a Draggable component, using the modal header as the handle and a body large enough to create a browser scrollbar. Confirm the current scrollbar movement and define done as moving the modal without moving the browser scrollbar.

Written by the indexing model from the issue text.

Description

If I wrap a Modal object from react-bootstrap within a Draggable tag, and if the Modal is too large for the browser window so that a vertical scroll bar appears in the browser, moving the Modal object with my mouse also moves the vertical scroll bar with it. The vertical scroll bar should stay right where it is and the Modal object should move independently with the mouse.

Here is a code snippet:

import { Modal } from 'react-bootstrap'
import Draggable from 'react-draggable'

export default class MyDraggableModal extends Component {

render() {
    return (
        <Draggable handle=".modal-header">
            <Modal animation={false} backdrop={false} show={true}>
                <Modal.Header>My Header</Modal.Header>
                <Modal.Body>
                    A large dialog so that vertical scroll bars will appear when the browser is resized too small....
                </Modal.Body>
                <Modal.Footer>My Footer</Modal.Footer>
            </Modal>
        </Draggable>
    )
}

}

Dominant language
JavaScript
Stars
9.3k
Forks
1k
Avg merge
3d 8h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-grid-layout/react-draggable

All issues in react-grid-layout/react-draggable

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.