Socket
Socket
Sign inDemoInstall

react-draggable

Package Overview
Dependencies
9
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
2345
8Next

4.4.6

Diff

Changelog

Source

4.4.6 (Sep 27, 2023)

  • Fix: state inconsistency in React 18 #699
  • Internal: devDependencies updates
strml
published 4.4.5 •

Changelog

Source

4.4.5 (Apr 26, 2022)

  • Fix: grid prop unused in handleDragStop #621
  • Fix: children prop missing in TypeScript definition #648
  • Internal: Various devDep updates
strml
published 4.4.4 •

Changelog

Source

4.4.4 (Aug 27, 2021)

  • Fix: Ensure documentElement.style actually exists. Fixes crashes in some obscure environments. #574 #575
  • Fix: Add react/react-dom as peerDependencies again to fix Yarn PnP
  • Size: Replace classnames with clsx to save a few bytes
  • Internal: Additional tests on ref functionality and additional README content on nodeRef
  • Internal: Lots of devDependencies updates
  • Docs: Various README and demo updates, see git commits
strml
published 4.4.3 •

Changelog

Source

4.4.3 (June 8, 2020)

  • Add nodeRef to TypeScript definitions
strml
published 4.4.2 •

Changelog

Source

4.4.2 (May 14, 2020)

  • Fix: Remove "module" from package.json (it is no longer being built)
    • Fixes #482
strml
published 4.4.1 •

Changelog

Source

4.4.1 (May 12, 2020)

  • Fix: Remove "module" definition in package.json
    • Giving up on this: there isn't a great reason to publish modules here as they won't be significantly tree-shook, and it bloats the published package.
    • Fixes incompatiblity in 4.4.0 with webpack, where webpack is now selecting "module" because "browser" is no longer present.
strml
published 4.4.0 •

Changelog

Source

4.4.0 (May 12, 2020)

  • Add nodeRef:
    • If running in React Strict mode, ReactDOM.findDOMNode() is deprecated. Unfortunately, in order for <Draggable> to work properly, we need raw access to the underlying DOM node. If you want to avoid the warning, pass a nodeRef as in this example:
      function MyComponent() {
        const nodeRef = React.useRef(null);
        return (
          <Draggable nodeRef={nodeRef}>
            <div ref={nodeRef}>Example Target</div>
          </Draggable>
        );
      }
      
      This can be used for arbitrarily nested components, so long as the ref ends up pointing to the actual child DOM node and not a custom component. Thanks to react-transition-group for the inspiration. nodeRef is also available on <DraggableCore>.
  • Remove "browser" field in "package.json":
    • There is nothing special in the browser build that is actually practical for modern use. The "browser" field, as defined in https://github.com/defunctzombie/package-browser-field-spec#overview, indicates that you should use it if you are directly accessing globals, using browser-specific features, dom manipulation, etc.

      React components like react-draggable are built to do minimal raw DOM manipulation, and to always gate this behind conditionals to ensure that server-side rendering still works. We don't make any changes to any of that for the "browser" build, so it's entirely redundant.

      This should also fix the "Super expression must either be null or a function" error (#472) that some users have experienced with particular bundler configurations.

      The browser build may still be imported at "build/web/react-draggable.min.js". This is to prevent breakage only. The file is no longer minified to prevent possible terser bugs.

    • The browser build will likely be removed entirely in 5.0.

  • Fix: Make bounds optional in TypeScript #473
strml
published 4.3.1 •

Changelog

Source

4.3.1 (Apr 11, 2020)

This is a bugfix release.

  • Happy Easter!
  • Fixed a serious bug that caused <DraggableCore> not to pass styles.
    • React.cloneElement has an odd quirk. When you do:
      return React.cloneElement(this.props.children, {style: this.props.children.props.style});
      
      , style ends up undefined.
  • Fixed a bug that caused debug output to show up in the build.
    • babel-loader cache does not invalidate when it should. I had modified webpack.config.js in the last version but it reused stale cache.
strml
published 4.3.0 •

Changelog

Source

4.3.0 (Apr 10, 2020)

  • Fix setState warning after dismount if drag still active. Harmless, but prints a warning. #424
  • Fix a long-standing issue where text inputs would unfocus upon dismounting a <Draggable>.
    • Thanks @schnerd, #450
  • Fix an issue where the insides of a <Draggable> were not scrollable on touch devices due to the outer container having touch-action: none.
    • This was a long-standing hack for mobile devices. Without it, the page will scroll while you drag the element.
    • The new solution will simply cancel the touch event e.preventDefault(). However, due to changes in Chrome >= 56, this is only possible on non-passive event handlers. To fix this, we now add/remove the touchEvent on lifecycle events rather than using React's event system.
    • #465
  • Upgrade devDeps and fix security warnings. None of them actually applied to this module.
strml
published 4.2.0 •

Changelog

Source

4.2.0 (Dec 2, 2019)

  • Fix: Apply scale parameter also while dragging an element. #438
  • Fix: Don't ship process.env.DRAGGABLE_DEBUG checks in cjs/esm. #445
2345
8Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc