- fix(types): fix issues with
skipLibCheck: false
- fix: improve build; check output for ES2018 compatibility
- fix: bundle to ES5 syntax
- chore: generate api docs
- fix: transform nullish coalescing; fix symbol-tree build
- fix(actions/gesture): fix error when inertia is enabled for gestures #995
- fix(actions/drop): fix regression with drop event targets #1016
- fix(types): import plugins for module augmentations #933
- fix(core/scope): remove duplicate Interactable super.unset
- fix(utils/pointerExtend): skip all vendor-prefixed props. Close #978
- fix(interact): remove types dependency
- fix: set "type": "module" for scoped packages
- fix(modifiers): allow toggling aspectRatio modifier during interaction
- fix(types): import plugins for module augmentations
- fix(interactjs): don't assign module.exports in esm package
- fixed missing typings when only the
@interactjs/interactjs
package is installed and imported - added index to vue package for installing with side effect import
- remove vue and react deps fron pro
@interactjs/interactjs
package
- fixed an issue with broken
@interactjs/types
#972
- fixed an issue with iframes on Webkit #942. Thanks, @tulps, for PR #943
- fixed top-right and bottom-left resizing with aspectRatio with sub-modifiers #944. Thanks again, @tulps, for PR #963
- fixed typings for
@itneractjs/
scoped module packages #933 - added
doubletap.double === true
event prop for consistency withtap.double
- fixed a bug with calling
interactable.unset()
in adrop
listener #919
- Added
.d.ts
files to all@interactjs/*
packages
- fixed incorrect behaviour when
interactable.unset()
is called multiple times
- fixed incorrect "module" field in package.json #894 (comment)
- fixed issue with unresolved stub files #894
- fixed commonjs import of
interactjs
package
- improved support for SSR environments
- fixed imports of missing modules #891
- correctly replace
process.env.npm_package_version
in min bundle #890
- fix packaging error
- fix packaging error
- fix NPE in indexOfDeepestElement if first element has no parent #887
- improve babel-plugin-prod on windows #885
- fixed issue with TS strict null checks #882
- fixed issue with type imports being emitted in JS modules #881
- marked interact.{on,off} methods as deprecated
- fixed mouseButtons option typings #865
- removed plugin index module warnings
- changed production files extension from '.min.js' to '.prod.js' #857
- added experimental
@interactjs/dev-tools/babel-plugin-prod
babel plugin to change@interactjs/*
imports to production versions - added
sideEffects
fields to package.json files
- fixed inertia issue with arbitrary plugin order #834
- fixed inertia regression #853
- used findIndex polyfill to support 1E11 #852
- fixed issue where resize reflow increased element size #817
- fixed drop event order: fire
dropmove
afterdragenter
#841 and final drop events beforedragend
#842 - updated docs #844 #829
- fixed ordering of plugins
- exposed
DropEvent
type
- fixed further issues with types
- fixed missing types for interactjs package
- fixed missing types for interactjs package
- fixed missing types for interactjs package
- fixed further regression breaking typescript builds #816
- fixed regression breaking typescript builds #816
- fixed regression breaking es5 compatibility of .min.js bundle #814
- fixed regression breaking commonjs imports withotu .default
- fixed issue with missing width/height on rectChecker result
- fixed resize checker with negative sizes
- moved generated plugin use modules to @interactjs//{use/,}/index.ts #800
- changed snap function args to provide interaction proxy
- restored dev-tools helpers in development bundle
- fixed issue with uninitialized scope in non browser env #803
- fixed typescript issue #807
- fixed minified bundle #802
- fixed issue with removing delegated events #801
- fixed typing issues
- improved package dependencies
- made
core
andutils
packages dependencies ofinteract
- restored
@interactjs/*/use/*.js*
builds
- fixed imports within generated modules
- added
@interactjs/*/use/*.min.js
builds - fixed issue with webpack minifier #800
- fixed typescript issues
- added various
@interactjs/*/use
packages for simpler selective imports #800 - fixed endOnly modifiers without inertia
- fixed a but causing incorrect modifications after resuming inertia #790
- fixed bug when calling interaction.move() from start event #791
- fixed bug when calling interaction.move() from start event #791
- fixed invalid non-array argument spread types #789
- fixed missing typescript definition of some interactable methods #788
- disabled
.d.ts.map
files output since the.ts
source files are not published - fixed typings for modifiers
- enabled
.d.ts.map
files output - added license field to @interactjs/interact package.json
- fixed an issue causing flickering a cursor on Firefox for Windows #781
Changes from prerelease versions listed below. See https://github.com/taye/interact.js/projects/4#column-7093512 for a list of issues and pull requests.
- fixed incorrect publish
- refactoring
- fixed
interact.snappers.grid
arg typings (https://twitter.com/ksumarine/status/1204457347856424960) - removed "?" from definitions for interact.{modifiers,snappers,createSnapGrid}
- fixed
modifiers.restrictSize
#779 - fixed option types in typescript and fixed devTools options #776
- reverted to typescript@3.6 to avoid backwards compatibility issues #775
- fixed dev scripts
- moved
interact.dynamicDrop
definition in order to avoid compilation errors
- added
main
field to interactjs package.json #774 - removed baseUrl from project tsconfig to avoid relative imports in generated declarations
- added missing typescript declaration files
- used non relative imports in .ts files with correct config for babel-plugin-bare-import-rewrite
- added
event.modifiers
array #772
- added
aspectRatio
modifier #638
- fixed
interact.snappers.grid
arg typings (https://twitter.com/ksumarine/status/1204457347856424960) - removed "?" from definitions for interact.{modifiers,snappers,createSnapGrid}
- fixed interactjs package main and browser fields #774
- reverted to typescript@3.6 to avoid backwards compatibility issues #775
- fixed typescript definition files #771
- reorganized modules for esnext resolution
- fixed hold repeat
event.count
- added esnext js builds #769
- fixed issue with inertia resume with
endOnly: false
#765
- @mlucool added license field to package.json of sub modules #755
- added
rect
,deltaRect
andedges
to resizestart and resizeend events #754
- fixed resize without invert
- avoided accessing deprecated event.mozPressure #751
- changed typings to use
HTMLElement | SVGElement
forevent.target
#747 - added
interacting
arg to cursorChecker #739 - added zIndex compare for sibling dropzones
- fixed broken modifiers #746
- fixed issues with old modifiers API
- fixed null restriction issue #737
- improved typings for modifiers
- fixed typing issues #738
- added
cursorChecker
option for drag and resize #736 - allowed restrictions larger than the target element #735
- added
interact.modifiers.restrictRect
with pre-set elementRect #735
- fixed issue with string restriction values that don't resolve to a rect #731
- changed plugin order so that
pointer-events
is installed beforeinertia
- fixed restrictSize min and max function restrictions
- fixed errors from calling
interaction.stop()
in start event #725
- fixed hold events #730
- fixed regression of preventing native drag behaviour #729
- fixed modifiers with inertia action-resume #728
- fixed docs for snap grid limits #717
- fixed exports in generated typings #727
- fixed exports in generated typings #726
- fixed pointerEvents currentTarget
- @0xflotus fixed typos in docs #724
- fixed error on iOS #682
- fixed an issue with interactions lingering on removed elements #723
- destroy only relevant interactions on interactable.unset()
- @jf-m fixed memory leaks and a bug on interactions stop PR #715
- fixed dropzones in shadow DOM PR #722
- fixed scripts to run bundle optimizations and fix issues with browserify
Most notablly:
interactable.reflow(action)
to re-run modifiers, drop, etc PR #610dropEvent.reject()
PR #613- snapEdges modifier PR #620
- per-action modifiers array PR #625
- autoStart set cursor on both target and <html> PR #639
- inertia: rename resume event to
${action}resume
interactable.reflow(action)
to re-run modifiers, drop, etc PR #610- added
options.listeners
array/object for actions snapEdges
modifier PR #620- fixed iOS preventDefault passive event issue (issue #631)
- added
console.warn
messages for common, easily detected issues - improved docs
- various fixes
Full list of changes on Github.
- fixed issues with action options (PR #567, issue #570)
- fixed iOS preventDefault passive event issue (issue #561)
- allowed calling
draggable.unset()
duringdragend
anddrop
event listeners (issue #560) - allowed snap to be enabled with falsey targets value issue #562
Most notably:
- changed the npm and bower package names to "interactjs" (issue #399
- major refactor with PR #231.
- removed deprecated methods:
Interactable
:squareResize
,snap
,restrict
,inertia
,autoScroll
,accept
interact
:enabbleDragging
,enableResizing
,enableGesturing
,margin
- new
hold
option for starting actions - new
interaction.end()
method (df963b0) snap.offset
self
option (issue #204)interaction.doMove()
(3489ee1) (c5c658a)- snap grid limits (d549672)
- improved iframe support (PR #313)
actionend
event dx/dy are now0
, not the difference between start and end coords (cbfaf00)- replaced drag
axis
option withstartAxis
andlockAxis
- added pointerEvents options:
- action events set with action method options (eg.
target.draggable({onmove})
are removed when that action is disabled with a method call (cca4e26) context
option now works for Element targets (8f64a7a)- added an action
mouseButtons
option and allowed actions only with the left mouse button by default (54ebdc3) - added repeating
hold
events (fe11a8e) - fixed
Interactable.off
(PR #477) - added
restrictEdges
,restrictSize
andsnapSize
resize modifiers (PR #455)
Full list of changes on Github.
interact(target).resizable({ preserveAspectRatio: true })
See PR #260.
interact.margin(number)
- Useinteract(target).resizable({ margin: number });
instead
- incorrect coordinates of the first movement of every action (5e5a040)
- warning about deprecated "webkitForce" event property (0943290)
- bugs with multiple concurrent interactions (ed53aee)
- iPad 1, iOS 5.1.1 error "undefined is not a function" when autoScroll is set to true (PR #194)
Full list of changes on Github
- Added
event
as the first argument to actionCheckers. See commit 88dc583 - Added
dragEvent
as the first parameter to drop.checker functions. See commits 16d74d4 and d0c4b69
interactable.accept - instead, use:
interact(target).dropzone({ accept: stringOrElement })
interactable.dropChecker - instead, use:
interact(target).dropzone({ checker: function () {} })
See #166 (comment)
- touch coords on Presto Opera Mobile - see commits 886e54c and 5a3a850
- bug with multiple pointers - see commit 64882d3
- accessing certain recently deprecated event properties in Blink - see commits e91fbc6 and 195cfe9
- dropzones with
accept: 'pointer'
in scrolled pages on iOS6 and lower - see commit 0b94aac - setting styleCursor through Interactable options object - see PR #270
- one missed interaction element on stop triggered - see PR #258
- pointer dt on touchscreen devices - see PR #215
- autoScroll with containers with fixed position - see commit 3635840
- autoScroll for mobile - see #180
- preventDefault - see commits 1984c80 and 6913959
- occasional error - see issue #183
- Interactable#unset - see PR #178
- coords of start event after manual start - see commit fec73b2
- bug with touch and selector interactables - see commit d8df3de
- touch doubletap bug - see 273f461
- event x0/y0 with origin - see PR #167
With the new resize edges API, you can resize from the top and left edges of an element in addition to the bottom and right. It also allows you to specify CSS selectors, regions or elements as the resize handles.
The arguments to dropChecker
functions have been expanded to include the
value of the default drop check and some other useful objects. See PR
161
If manuanStart is true
, default prevention will happen only while
interacting. Related to Issue
138.
This removes a small inaccuracy when snapping with one or more
relativeOffsets
.
Basic support for ShadowDOM was implemented in PR 143
Fixed Interactable#on({ type: listener }). b8a5e89
Added a double
property to tap events. tap.double === true
if the tap will
be followed by a doubletap
event. See issue
155.
Fixed issue 150.
See issue 149.
Gestures were completely broken in v1.2.0. They're fixed now.
Fixed restriction to an element when the element doesn't have a rect (display: none
, not in DOM, etc.). Issue
144.
Multiple interactions have been enabled by default. For example:
interact('.drag-element').draggable({
enabled: true,
// max : Infinity, // default
// maxPerElement: 1, // default
})
will allow multiple .drag-element
to be dragged simultaneously without having
to explicitly set max: integerGreaterThan1
. The default
maxPerElement
value is still 1 so only one drag would be able to happen on
each .drag-element
unless the maxPerElement
is changed.
If you don't want multiple interactions, call interact.maxInteractions(1)
.
Snap modes have been
unified. A targets
array
now holds all the snap objects and functions for snapping.
interact.createSnapGrid(gridObject)
returns a function that snaps to the
dimensions of the given grid.
interact(target).draggable({
snap: {
targets: [{ x: 300, y: 300 }],
relativePoints: [
{ x: 0, y: 0 }, // snap relative to the top left of the element
{ x: 1, y: 1 }, // and also to the bottom right
],
// offset the snap target coordinates
// can be an object with x/y or 'startCoords'
offset: { x: 50, y: 50 },
},
})
The current Interaction
is now passed as the third parameter to snap functions.
interact(target).draggable({
snap: {
targets: [
function (x, y, interaction) {
if (!interaction.dropTarget) {
return { x: 0, y: 0 }
}
},
],
},
})
The snap.relativePoints
array succeeds the snap.elementOriign object. But
backwards compatibility with elementOrigin
and the old snapping interface is
maintained.
snap.offset
lets you offset all snap target coords.
See this PR for more info.
Snapping now occurs if the distance to the snap target is less than or equal to the target's range.
inertia.zeroResumeDelta
is now true
by default.
Snap, restrict, inertia, autoScroll can be different for drag, restrict and gesture. See PR 115.
Methods for these settings on the interact
object (interact.snap()
,
interact.autoScroll()
, etc.) have been removed.
function logEventType(event) {
console.log(event.type, event.target)
}
interact(target).on('down tap dragstart gestureend', logEventType)
interact(target).on(['move', 'resizestart'], logEventType)
interact(target).on({
dragmove: logEvent,
keydown: logEvent,
})
The expected return value from an action checker has changed from a string to
an object. The object should have a name
and can also have an axis
property. For example, to resize horizontally:
interact(target)
.resizeable(true)
.actionChecker(function (pointer, defaultAction, interactable, element) {
return {
name: 'resize',
axis: 'x',
}
})
All drop-related events are now plain
objects. The related drag
events are referenced in their dragEvent
property.
The method takes one of the above string values. It will still accept
true
/false
parameters which are changed to 'always'
/'never'
.
Adding a function as a listener for an InteractEvent or pointerEvent type multiple times will cause that function to be fired multiple times for the event. Previously, adding the event type + function combination again had no effect.
Added new event types down, move, up, cancel, hold.
Tap and doubletap with multiple pointers was improved.
Added a workaround for IE8's unusual dblclick event sequence so that doubletap events are fired.
Fixed a tapping issue on Windows Phone/RT.
Fixed a bug that caused the origins of all elements with tap listeners to be subtracted successively as a tap event propagated.
Fixed delegated events when different contexts have been used.
Added basic support for sharing one instance of interact.js between multiplie windows/frames. There are still some issues.