getComputedStyle
error: see #186, #190offsetParent
property for an arbitrary ancestor for offset calculations.offsetParent
.return false
to cancel onDrag
breaking on both old and new browsers due to missing typeArg
and/or
unsupported MouseEventConstructor
. Fixes #164.<DraggableCore>
wasn't calling back with the DOM node.handle
or cancel
selectors if the event originates from a child of the handle or cancel.position
/ defaultPosition
.global.SVGElement
. Fixes JSDOM & #123.<Draggable>
s with a position
property will still be draggable, but will revert to their old position
on drag stop. Attach an onStop
or onDrag
handler to synchronize state.<Draggable>
controlled but attach no callback
handlers, a warning will be printed.<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
};
start
option has been renamed to defaultPosition
.zIndex
option has been removed.offsetParent
.
This method allows us to support arbitrary nested scrollable ancestors without scroll handlers!<Draggable>
now has a position
attribute. Its relationship to defaultPosition
is much like
value
to defaultValue
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.user-select
prefixing, which may be different than the prefix required for transform
.<Draggable>
fires drag
events, as they should have been.'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.'parent'
, you can select any element
on the page, including 'body'
.<Draggable>
is unmounted while dragging.<DraggableCore>
handles deltas only and does not keep state. Added new state
properties slackX
and slackY
to <Draggable>
to handle this and restore pre-v1 behavior.window
<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.NaN
was returning from scroll events due to event structure change.grid
into <DraggableCore>
directly. It will continue to work on <Draggable>
.enableUserSelectHack
not properly disabling.allowAnyClick
option to allow other click types.resetState()
instance methodmoveOnStartChange
prop0.14
support only.<DraggableCore>
element upon which <Draggable>
is based.
This module is useful for building libraries and is completely stateless.transform
attribute instead of style
. Thanks @martinRosse.changedTouches
check.resetState()
instance method for use by parents. See README ("State Problems?").0,0
would cause the element to remain in an inaccurate position,
because the translation was removed from the CSS. See #55.moveOnStartChange
optimization that was causing problems when attempting to move a <Draggable>
back
to its initial position. See https://github.com/STRML/react-grid-layout/issues/56moveOnStartChange
property. See README.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.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.false
.grid
option was active.user-select:none
hack to document.body for better highlight prevention.bounds
option to restrict dragging within parent or within coordinates."browser"
config to package.json for browserify imports (fix #45).emptyFunction
and React.addons.classSet
imports.react
directly).