- Bugfix: Fix "Cannot call property 'call' of undefined" (matchesSelector) = Fixes #300
- Bugfix: Fix deprecation warnings caused by
import * as React
(Flow best practice).
3.0.0 and 3.0.1 have been unpublished due to a large logfile making it into the package.
- Bugfix: Tweaked
.npmignore
.
- Bugfix: Flow-type should no longer throw errors for consumers.
- It appears Flow can't resolve a sub-package's interfaces.
Due to an export change, this is semver-major.
- Breaking: For TypeScript users,
<Draggable>
is now exported asmodule.exports
andmodule.exports.default
. - Potentially Breaking: We no longer set
user-select: none
on all elements while dragging. Instead, the::selection
psuedo element is used.- Depending on your application, this could cause issues, so be sure to test.
- Bugfix: Pass bounded
x
/y
to callbacks. See #226. - Internal: Upgraded dependencies.
- Bugfix: Missing export default on TS definition (thanks @lostfictions)
- Internal: TS test suite (thanks @lostfictions)
- Bugfix: Typescript definition was incorrect. #244
- Internal: Moved
PropTypes
access toprop-types
package for React 15.5 (prep for 16) - Feature: Added TypeScript definitions (thanks @erfangc)
- Bugfix: No longer can erroneously add user-select style multiple times
- Bugfix: OffsetParent with padding problem, fixes #218
- Refactor: Misc example updates.
- Bugfix: Fix an issue with the entire window scrolling on a drag on iDevices. Thanks @JaneCoder. See #183
- Bugfix: Fix references to global when grabbing
SVGElement
, see #162 - Bugfix: Get
ownerDocument
beforeonStop
, fixes #198
- Bugfix: Fix
getComputedStyle
error: see #186, #190
- Addition:
offsetParent
property for an arbitrary ancestor for offset calculations.- Fixes e.g. dragging with a floating
offsetParent
.
- Fixes e.g. dragging with a floating
- Enhancement: Make this library iframe-aware.
- Ref: react-grid-layout#177
- Thanks to @acusti for tests
- Bugfix: Lint/Test Fixes for new Flow & React versions
- Bugfix: Fix
return false
to cancelonDrag
breaking on both old and new browsers due to missingtypeArg
and/or unsupportedMouseEventConstructor
. Fixes #164.
- Bugfix:
<DraggableCore>
wasn't calling back with the DOM node. - Internal: Rework test suite to use power-assert.
- Fix improperly missed
handle
orcancel
selectors if the event originates from a child of the handle or cancel.- Fixes a longstanding issue, #88
- This was pushed to a minor release as there may be edge cases (perhaps workarounds) where this changes behavior.
- Fix
cannot access clientX of undefined
on some touch-enabled platforms. - Fixed a bug with multi-finger multitouch if > 1 finger triggered an event at the same time.
- Finally fixed the IE10 constructor bug. Thanks @davidstubbs #158
- This is a breaking change. See the changes below in the beta releases.
- Note the changes to event callbacks and
position
/defaultPosition
.
- Note the changes to event callbacks and
- Changes from 2.0.0-beta3:
- Small bugfixes for Flow 0.24 compatibility.
- Don't assume
global.SVGElement
. Fixes JSDOM & #123.
- Flow comments are now in the build. Other projects, such as React-Grid-Layout and React-Resizable, will rely on them in their build and export their own comments.
- We're making a small deviation from React Core's controlled vs. uncontrolled scheme; for convenience,
<Draggable>
s with aposition
property will still be draggable, but will revert to their old position on drag stop. Attach anonStop
oronDrag
handler to synchronize state.- A warning has been added informing users of this. If you make
<Draggable>
controlled but attach no callback handlers, a warning will be printed.
- A warning has been added informing users of this. If you make
- Due to API changes, this is a major release.
- Both
<DraggableCore>
and<Draggable>
have had their callback types changed and unified.
type DraggableEventHandler = (e: Event, data: DraggableData) => void | false;
type DraggableData = {
node: HTMLElement,
// lastX + deltaX === x
x: number, y: number,
deltaX: number, deltaY: number,
lastX: number, lastY: number
};
- The
start
option has been renamed todefaultPosition
. - The
zIndex
option has been removed.
- When determining deltas, we now use a new method that checks the delta against the Draggable's
offsetParent
. This method allows us to support arbitrary nested scrollable ancestors without scroll handlers!- This may cause issues in certain layouts. If you find one, please open an issue.
<Draggable>
now has aposition
attribute. Its relationship todefaultPosition
is much likevalue
todefaultValue
on React<input>
nodes. If set, the position is fixed and cannot be mutated. If empty, the component will manage its own state. See #140 for more info & motivations.- Misc. bugfixes.
- Major improvements to drag tracking that now support even nested scroll boxes.
- This revision is being done as a pre-release to ensure there are no unforeseen issues with the offset changes.
- Fix
user-select
prefixing, which may be different than the prefix required fortransform
.
- Republished after 1.3.5 contained a bundling error.
- Add React v15 to devDeps.
<Draggable>
supports bothv0.14
andv15
. - Enhancement: Clean up usage of browser prefixes; modern browsers will no longer use them.
- This also removes the duplicated
user-select
style that is created on the<body>
while dragging.
- This also removes the duplicated
- Internal: Test fixes.
- Bugfix: Scrolling while dragging caused items to move unpredictably.
- Bugfix: #116: Android/Chrome are finicky; give up on canceling ghost clicks entirely.
- Bugfix: #116: Child inputs not focusing on touch events.
- Internal: Babel 6 and Flow definitions
- Bugfix: 1.3.0 broke string bounds ('parent', selectors, etc.).
- Bugfix: 1.3.0 wasn't updating deltaX and deltaY on a bounds hit.
- Possibly breaking change: bounds are calculated before
<Draggable>
firesdrag
events, as they should have been. - Added
'none'
axis type. This allows using<Draggable>
somewhat like<DraggableCore>
- state will be kept internally (which makes bounds checks etc possible), but updates will not be flushed to the DOM. - Performance tweaks.
- Added arbitrary boundary selector. Now you don't have to just use
'parent'
, you can select any element on the page, including'body'
. - Bugfix: Prevent invariant if a
<Draggable>
is unmounted while dragging. - Bugfix: Fix #133, where items would eagerly start dragging off the mouse cursor if you hit boundaries and
came back. This is due to how
<DraggableCore>
handles deltas only and does not keep state. Added new state propertiesslackX
andslackY
to<Draggable>
to handle this and restore pre-v1 behavior.
- Bugfix: Server-side rendering with react-rails, which does bad things like mock
window
- Bugfix:
<Draggable>
was calling back with clientX/Y, not offsetX/Y as it did pre-1.0. This unintended behavior has been fixed and a test has been added.
- Bugfix: Clean up scroll events if a component is unmounted before drag stops.
- Bugfix:
NaN
was returning from scroll events due to event structure change. - Add scroll drag modulation test.
- Move
grid
into<DraggableCore>
directly. It will continue to work on<Draggable>
. - Development fixes.
- Fix
enableUserSelectHack
not properly disabling. - Fix a crash when the user scrolls the page with a Draggable active.
- Fix missing dist files for webpack.
- Ignore non-primary clicks. Added
allowAnyClick
option to allow other click types.
- Breaking: Removed
resetState()
instance method - Breaking: Removed
moveOnStartChange
prop - Breaking: React
0.14
support only. - Refactored project.
- Module now exports a
<DraggableCore>
element upon which<Draggable>
is based. This module is useful for building libraries and is completely stateless.
- Bugfix: isElementSVG no longer can be overwritten by getInitialState (#83)
- Bugfix: Fix for element prefixes in JSDOM
- Bugfix: SVG elements now properly use
transform
attribute instead ofstyle
. Thanks @martinRoss
- Bugfix: Short-circuiting drag throws due to
e.changedTouches
check.
- Handle scrolling while dragging. (#60)
- Add multi-touch support. (#68)
- IE fixes.
- Documentation updates. (#77)
- Add
resetState()
instance method for use by parents. See README ("State Problems?").
- Touch/mouse events rework. Fixes #51, #37, and #43, as well as IE11 support.
- Moved mousemove/mouseup and touch event handlers to document from window. Fixes IE9/10 support. IE8 is still not supported, as it is not supported by React.
- Fix a bug where a quick drag out of bounds to
0,0
would cause the element to remain in an inaccurate position, because the translation was removed from the CSS. See #55.
- Removed a
moveOnStartChange
optimization that was causing problems when attempting to move a<Draggable>
back to its initial position. See react-grid-layout/react-grid-layout#56
- Added
moveOnStartChange
property. See README.
- The
start
param is back. Pass{x: Number, y: Number}
to kickoff the CSS transform. Useful in certain cases for simpler callback math (so you don't have to know its existing relative position and add it to the dragged position). Fixes #52.
- Breaking change:
bounds
with coordinates was confusing because it was using the item's width/height, which was not intuitive. When providing coordinates,bounds
now simply restricts movement in each direction by that many pixels.
- Breaking change: Cancel dragging when onDrag or onStart handlers return an explicit
false
. - Fix sluggish movement when
grid
option was active. - Example updates.
- Move
user-select:none
hack to document.body for better highlight prevention. - Add
bounds
option to restrict dragging within parent or within coordinates.
- Remove browserify browser config, reactify, and jsx pragma. Fixes #38
- Use React.cloneElement instead of addons cloneWithProps (requires React 0.13)
- Move to CSS transforms. Simplifies implementation and fixes #48, #34, #31.
- Fixup linting and space/tab errors. Fixes #46.
- Fix React.addons error caused by faulty test.
- Add
"browser"
config to package.json for browserify imports (fix #45). - Remove unnecessary
emptyFunction
andReact.addons.classSet
imports.
- Remove react/addons dependency (now depending on
react
directly). - Add MIT License file.
- Fix an issue where browser may be detected as touch-enabled but touch event isn't thrown.
- Improving accuracy of snap to grid
- Updating to React 0.12
- Adding dragging className
- Adding reactify support for browserify
- Fixing issue with server side rendering
- Adding support for touch devices
- Exporting as ReactDraggable
- Adding support for snapping to a grid
- Adding support for specifying start position
- Ensure event handlers are destroyed on unmount
- Adding browserify support
- Adding bower support
- Fixing dragging not stopping on mouseup in some cases
- Initial release