UNPKG

14.7 kBMarkdownView Raw
1# Changelog
2
3### 3.1.1 (Dec 21, 2018)
4
5- Bugfix: Minor type change on DraggableEventHandler TypeScript export ([#374](https://github.com/mzabriskie/react-draggable/pull/374))
6
7### 3.1.0 (Dec 21, 2018)
8
9- Feature: Added `scale` prop ([#352](https://github.com/mzabriskie/react-draggable/pull/352))
10 - Thanks, @wootencl
11- Bugfix: Remove process.browser which is missing in browser ([#329]((https://github.com/mzabriskie/react-draggable/pull/329))
12- Bugfix: Fix selection api on IE ([#292](https://github.com/mzabriskie/react-draggable/pull/292))
13- Bugfix: Fixes some issues in the type definitions for TypeScript ([#331]((https://github.com/mzabriskie/react-draggable/pull/331))
14- Bugfix: Fix compare where portal elements are different instance to main window ([#359]((https://github.com/mzabriskie/react-draggable/pull/359))
15
16### 3.0.5 (Jan 11, 2018)
17
18- Bugfix: Fix crash in test environments during removeUserSelectStyles().
19
20### 3.0.4 (Nov 27, 2017)
21
22- Bugfix: Fix "Cannot call property 'call' of undefined" (matchesSelector)
23 - Fixes [#300](https://github.com/mzabriskie/react-draggable/issues/300)
24
25### 3.0.3 (Aug 31, 2017)
26
27- Bugfix: Fix deprecation warnings caused by `import * as React` (Flow best practice).
28 - See https://github.com/facebook/react/issues/10583
29
30### 3.0.2 (Aug 22, 2017)
31
32> 3.0.0 and 3.0.1 have been unpublished due to a large logfile making it into the package.
33
34- Bugfix: Tweaked `.npmignore`.
35
36### 3.0.1 (Aug 21, 2017)
37
38- Bugfix: Flow-type should no longer throw errors for consumers.
39 - It appears Flow can't resolve a sub-package's interfaces.
40
41### 3.0.0 (Aug 21, 2017)
42
43> Due to an export change, this is semver-major.
44
45- Breaking: For TypeScript users, `<Draggable>` is now exported as `module.exports` and `module.exports.default`.
46- Potentially Breaking: We no longer set `user-select: none` on all elements while dragging. Instead,
47 the [`::selection` psuedo element](https://developer.mozilla.org/en-US/docs/Web/CSS/::selection) is used.
48 - Depending on your application, this could cause issues, so be sure to test.
49- Bugfix: Pass bounded `x`/`y` to callbacks. See [#226](https://github.com/mzabriskie/react-draggable/pull/226).
50- Internal: Upgraded dependencies.
51
52### 2.2.6 (Apr 30, 2017)
53
54- Bugfix: Missing export default on TS definition (thanks @lostfictions)
55- Internal: TS test suite (thanks @lostfictions)
56
57### 2.2.5 (Apr 28, 2017)
58
59- Bugfix: Typescript definition was incorrect. [#244](https://github.com/mzabriskie/react-draggable/issues/244)
60
61### 2.2.4 (Apr 27, 2017)
62
63- Internal: Moved `PropTypes` access to `prop-types` package for React 15.5 (prep for 16)
64- Feature: Added TypeScript definitions (thanks @erfangc)
65- Bugfix: No longer can erroneously add user-select style multiple times
66- Bugfix: OffsetParent with padding problem, fixes [#218](https://github.com/mzabriskie/react-draggable/issues/218)
67- Refactor: Misc example updates.
68
69### 2.2.3 (Nov 21, 2016)
70
71- Bugfix: Fix an issue with the entire window scrolling on a drag on iDevices. Thanks @JaneCoder. See #183
72
73### 2.2.2 (Sep 14, 2016)
74
75- Bugfix: Fix references to global when grabbing `SVGElement`, see [#162](https://github.com/mzabriskie/react-draggable/issues/162)
76- Bugfix: Get `ownerDocument` before `onStop`, fixes [#198](https://github.com/mzabriskie/react-draggable/issues/198)
77
78### 2.2.1 (Aug 11, 2016)
79
80- Bugfix: Fix `getComputedStyle` error: see [#186](https://github.com/mzabriskie/react-draggable/issues/186), #190
81
82### 2.2.0 (Jul 29, 2016)
83
84- Addition: `offsetParent` property for an arbitrary ancestor for offset calculations.
85 - Fixes e.g. dragging with a floating `offsetParent`.
86 - Ref: https://github.com/mzabriskie/react-draggable/issues/170
87- Enhancement: Make this library iframe-aware.
88 - Ref: https://github.com/mzabriskie/react-draggable/pull/177
89 - Thanks to @acusti for tests
90- Bugfix: Lint/Test Fixes for new Flow & React versions
91
92### 2.1.2 (Jun 5, 2016)
93
94- Bugfix: Fix `return false` to cancel `onDrag` breaking on both old and new browsers due to missing `typeArg` and/or
95 unsupported `MouseEventConstructor`. Fixes [#164](https://github.com/mzabriskie/react-draggable/issues/164).
96
97### 2.1.1 (May 22, 2016)
98
99- Bugfix: `<DraggableCore>` wasn't calling back with the DOM node.
100- Internal: Rework test suite to use power-assert.
101
102### 2.1.0 (May 20, 2016)
103
104- Fix improperly missed `handle` or `cancel` selectors if the event originates from a child of the handle or cancel.
105 - Fixes a longstanding issue, [#88](https://github.com/mzabriskie/react-draggable/pull/88)
106 - This was pushed to a minor release as there may be edge cases (perhaps workarounds) where this changes behavior.
107
108### 2.0.2 (May 19, 2016)
109
110- Fix `cannot access clientX of undefined` on some touch-enabled platforms.
111 - Fixes [#159](https://github.com/mzabriskie/react-draggable/pull/159),
112 [#118](https://github.com/mzabriskie/react-draggable/pull/118)
113- Fixed a bug with multi-finger multitouch if > 1 finger triggered an event at the same time.
114
115### 2.0.1 (May 19, 2016)
116
117- Finally fixed the IE10 constructor bug. Thanks @davidstubbs [#158](https://github.com/mzabriskie/react-draggable/pull/158)
118
119### 2.0.0 (May 10, 2016)
120
121- This is a breaking change. See the changes below in the beta releases.
122 - Note the changes to event callbacks and `position` / `defaultPosition`.
123- Changes from 2.0.0-beta3:
124 - Small bugfixes for Flow 0.24 compatibility.
125 - Don't assume `global.SVGElement`. Fixes JSDOM & [#123](https://github.com/mzabriskie/react-draggable/issues/123).
126
127### 2.0.0-beta3 (Apr 19, 2016)
128
129- Flow comments are now in the build. Other projects, such as React-Grid-Layout and React-Resizable, will
130 rely on them in their build and export their own comments.
131
132### 2.0.0-beta2 (Apr 14, 2016)
133
134- We're making a small deviation from React Core's controlled vs. uncontrolled scheme; for convenience,
135 `<Draggable>`s with a `position` property will still be draggable, but will revert to their old position
136 on drag stop. Attach an `onStop` or `onDrag` handler to synchronize state.
137 - A warning has been added informing users of this. If you make `<Draggable>` controlled but attach no callback
138 handlers, a warning will be printed.
139
140### 2.0.0-beta1 (Apr 14, 2016)
141
142- Due to API changes, this is a major release.
143
144#### Breaking Changes:
145
146- Both `<DraggableCore>` and `<Draggable>` have had their callback types changed and unified.
147
148```js
149type DraggableEventHandler = (e: Event, data: DraggableData) => void | false;
150type DraggableData = {
151 node: HTMLElement,
152 // lastX + deltaX === x
153 x: number, y: number,
154 deltaX: number, deltaY: number,
155 lastX: number, lastY: number
156};
157```
158
159- The `start` option has been renamed to `defaultPosition`.
160- The `zIndex` option has been removed.
161
162#### Possibly Breaking Changes:
163
164- When determining deltas, we now use a new method that checks the delta against the Draggable's `offsetParent`.
165 This method allows us to support arbitrary nested scrollable ancestors without scroll handlers!
166 - This may cause issues in certain layouts. If you find one, please open an issue.
167
168#### Enhancements:
169
170- `<Draggable>` now has a `position` attribute. Its relationship to `defaultPosition` is much like
171 `value` to `defaultValue` on React `<input>` nodes. If set, the position is fixed and cannot be mutated.
172 If empty, the component will manage its own state. See [#140](https://github.com/mzabriskie/react-draggable/pull/140)
173 for more info & motivations.
174- Misc. bugfixes.
175
176### 1.4.0-beta1 (Apr 13, 2016)
177
178- Major improvements to drag tracking that now support even nested scroll boxes.
179 - This revision is being done as a pre-release to ensure there are no unforeseen issues with the offset changes.
180
181### 1.3.7 (Apr 8, 2016)
182
183- Fix `user-select` prefixing, which may be different than the prefix required for `transform`.
184
185### 1.3.6 (Apr 8, 2016)
186
187- Republished after 1.3.5 contained a bundling error.
188
189### 1.3.5 (Apr 8, 2016)
190
191- Add React v15 to devDeps. `<Draggable>` supports both `v0.14` and `v15`.
192- Enhancement: Clean up usage of browser prefixes; modern browsers will no longer use them.
193 - This also removes the duplicated `user-select` style that is created on the `<body>` while dragging.
194- Internal: Test fixes.
195
196### 1.3.4 (Mar 5, 2016)
197
198- Bugfix: Scrolling while dragging caused items to move unpredictably.
199
200### 1.3.3 (Feb 11, 2016)
201
202- Bugfix: #116: Android/Chrome are finicky; give up on canceling ghost clicks entirely.
203
204### 1.3.2 (Feb 11, 2016)
205
206- Bugfix: #116: Child inputs not focusing on touch events.
207
208### 1.3.1 (Feb 10, 2016)
209
210- Internal: Babel 6 and Flow definitions
211- Bugfix: 1.3.0 broke string bounds ('parent', selectors, etc.).
212- Bugfix: 1.3.0 wasn't updating deltaX and deltaY on a bounds hit.
213
214### 1.3.0 (Feb 10, 2016)
215
216- Possibly breaking change: bounds are calculated before `<Draggable>` fires `drag` events, as they should have been.
217- Added `'none'` axis type. This allows using `<Draggable>` somewhat like `<DraggableCore>` - state will be kept
218 internally (which makes bounds checks etc possible), but updates will not be flushed to the DOM.
219- Performance tweaks.
220
221### 1.2.0 (Feb 5, 2016)
222
223- Added arbitrary boundary selector. Now you don't have to just use `'parent'`, you can select any element
224 on the page, including `'body'`.
225- Bugfix: Prevent invariant if a `<Draggable>` is unmounted while dragging.
226- Bugfix: Fix #133, where items would eagerly start dragging off the mouse cursor if you hit boundaries and
227 came back. This is due to how `<DraggableCore>` handles deltas only and does not keep state. Added new state
228 properties `slackX` and `slackY` to `<Draggable>` to handle this and restore pre-v1 behavior.
229
230### 1.1.3 (Nov 25, 2015)
231
232- Bugfix: Server-side rendering with react-rails, which does bad things like mock `window`
233
234### 1.1.2 (Nov 23, 2015)
235
236- Bugfix: `<Draggable>` was calling back with clientX/Y, not offsetX/Y as it did pre-1.0. This unintended
237 behavior has been fixed and a test has been added.
238
239### 1.1.1 (Nov 14, 2015)
240
241- Bugfix: Clean up scroll events if a component is unmounted before drag stops.
242- Bugfix: `NaN` was returning from scroll events due to event structure change.
243- Add scroll drag modulation test.
244
245### 1.1.0 (Nov 14, 2015)
246
247- Move `grid` into `<DraggableCore>` directly. It will continue to work on `<Draggable>`.
248- Development fixes.
249
250### 1.0.2 (Nov 7, 2015)
251
252- Fix `enableUserSelectHack` not properly disabling.
253- Fix a crash when the user scrolls the page with a Draggable active.
254
255### 1.0.1 (Oct 28, 2015)
256
257- Fix missing dist files for webpack.
258- Ignore non-primary clicks. Added `allowAnyClick` option to allow other click types.
259
260### 1.0.0 (Oct 27, 2015)
261
262- Breaking: Removed `resetState()` instance method
263- Breaking: Removed `moveOnStartChange` prop
264- Breaking: React `0.14` support only.
265- Refactored project.
266- Module now exports a `<DraggableCore>` element upon which `<Draggable>` is based.
267 This module is useful for building libraries and is completely stateless.
268
269### 0.8.5 (Oct 20, 2015)
270
271- Bugfix: isElementSVG no longer can be overwritten by getInitialState (#83)
272- Bugfix: Fix for element prefixes in JSDOM
273
274### 0.8.4 (Oct 15, 2015)
275
276- Bugfix: SVG elements now properly use `transform` attribute instead of `style`. Thanks @martinRoss
277
278### 0.8.3 (Oct 12, 2015)
279
280- Bugfix: Short-circuiting drag throws due to `e.changedTouches` check.
281
282### 0.8.2 (Sep 21, 2015)
283
284- Handle scrolling while dragging. (#60)
285- Add multi-touch support. (#68)
286- IE fixes.
287- Documentation updates. (#77)
288
289### 0.8.1 (June 3, 2015)
290
291- Add `resetState()` instance method for use by parents. See README ("State Problems?").
292
293### 0.8.0 (May 19, 2015)
294
295- Touch/mouse events rework. Fixes #51, #37, and #43, as well as IE11 support.
296- Moved mousemove/mouseup and touch event handlers to document from window. Fixes IE9/10 support.
297 IE8 is still not supported, as it is not supported by React.
298
299### 0.7.4 (May 18, 2015)
300
301- Fix a bug where a quick drag out of bounds to `0,0` would cause the element to remain in an inaccurate position,
302 because the translation was removed from the CSS. See #55.
303
304### 0.7.3 (May 13, 2015)
305
306- Removed a `moveOnStartChange` optimization that was causing problems when attempting to move a `<Draggable>` back
307 to its initial position. See https://github.com/STRML/react-grid-layout/issues/56
308
309### 0.7.2 (May 8, 2015)
310
311- Added `moveOnStartChange` property. See README.
312
313### 0.7.1 (May 7, 2015)
314
315- The `start` param is back. Pass `{x: Number, y: Number}` to kickoff the CSS transform. Useful in certain
316 cases for simpler callback math (so you don't have to know its existing relative position and add it to
317 the dragged position). Fixes #52.
318
319### 0.7.0 (May 7, 2015)
320
321- Breaking change: `bounds` with coordinates was confusing because it was using the item's width/height,
322 which was not intuitive. When providing coordinates, `bounds` now simply restricts movement in each
323 direction by that many pixels.
324
325### 0.6.0 (May 2, 2015)
326
327- Breaking change: Cancel dragging when onDrag or onStart handlers return an explicit `false`.
328- Fix sluggish movement when `grid` option was active.
329- Example updates.
330- Move `user-select:none` hack to document.body for better highlight prevention.
331- Add `bounds` option to restrict dragging within parent or within coordinates.
332
333### 0.5.0 (May 2, 2015)
334
335- Remove browserify browser config, reactify, and jsx pragma. Fixes #38
336- Use React.cloneElement instead of addons cloneWithProps (requires React 0.13)
337- Move to CSS transforms. Simplifies implementation and fixes #48, #34, #31.
338- Fixup linting and space/tab errors. Fixes #46.
339
340### 0.4.3 (Apr 30, 2015)
341
342- Fix React.addons error caused by faulty test.
343
344### 0.4.2 (Apr 30, 2015)
345
346- Add `"browser"` config to package.json for browserify imports (fix #45).
347- Remove unnecessary `emptyFunction` and `React.addons.classSet` imports.
348
349### 0.4.1 (Apr 30, 2015)
350
351- Remove react/addons dependency (now depending on `react` directly).
352- Add MIT License file.
353- Fix an issue where browser may be detected as touch-enabled but touch event isn't thrown.
354
355### 0.4.0 (Jan 03, 2015)
356
357- Improving accuracy of snap to grid
358- Updating to React 0.12
359- Adding dragging className
360- Adding reactify support for browserify
361- Fixing issue with server side rendering
362
363### 0.3.0 (Oct 21, 2014)
364
365- Adding support for touch devices
366
367### 0.2.1 (Sep 10, 2014)
368
369- Exporting as ReactDraggable
370
371### 0.2.0 (Sep 10, 2014)
372
373- Adding support for snapping to a grid
374- Adding support for specifying start position
375- Ensure event handlers are destroyed on unmount
376- Adding browserify support
377- Adding bower support
378
379### 0.1.1 (Jul 26, 2014)
380
381- Fixing dragging not stopping on mouseup in some cases
382
383### 0.1.0 (Jul 25, 2014)
384
385- Initial release