Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong offsetParent propType #219

Open
1 of 3 tasks
hejtful opened this issue Apr 27, 2023 · 0 comments · May be fixed by #220
Open
1 of 3 tasks

Wrong offsetParent propType #219

hejtful opened this issue Apr 27, 2023 · 0 comments · May be fixed by #220

Comments

@hejtful
Copy link

hejtful commented Apr 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant