Skip to content

Wrong offsetParent propType #219

Open
@hejtful

Description

@hejtful

Thanks for opening an issue!

Please select the type of issue you're reporting. For questions.

  • Bug
  • Feature Request
  • Question

Problem Report

react-draggable expects the property offsetParent to be an HTMLElement (relevant line in react-draggable source code)

react-resizable has the propType of offsetParent set to PropTypes.node, so when an HTML Element is passed, an error is printed in the console:
Warning: Failed prop type: Invalid prop `draggableOpts.offsetParent` supplied to `Resizable`, expected a ReactNode.

Note: The offsetParent property is important because of this issue and this fix/workaround of that issue.

Reproduction

https://codesandbox.io/s/react-resizable-playground-forked-c673dc?file=/src/index.js

Note: The Codesandbox link of the issue template had an old version of react-resizable, so I first updated it, and then added the offsetParent property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions