![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@telerik/kendo-draggable
Advanced tools
Readme
A repository for the cross-platform abstraction for drag sequences.
The Kendo UI Draggable component handles mouse drags and touch sequences on mobile devices.
A drag sequence means:
The library is published as a scoped NPM package in the NPMJS Telerik account.
npm install --save '@telerik/kendo-draggable';
The draggable
class constructor accepts an object with three optional event handler callbacks—press
, drag
, and release
.
import Draggable from '@telerik/kendo-draggable';
const draggable = new Draggable({
press: function(e) {
console.log("pressed", e.pageX, e.pageY);
},
drag: function(e) {
console.log("drag", e.pageX, e.pageY);
},
release: function(e) {
console.log("release", e.pageX, e.pageY);
}
});
draggable.bindTo(document.getElementById("my-element"));
The Draggable may be re-bound to another element—the event handlers will be automatically unbound from the previous one.
draggable.bindTo(document.getElementById("another-element"));
The draggable
object persists a reference to the currently bound element. That is why it should be destroyed when or if the corresponding element is removed from the document.
draggable.destroy();
The Kendo UI Draggable supports:
Handling the drag sequence on mobile devices may require the disabling of the touch-based scrolling. The Draggable will not do that out of the box. The recommended way to handle this issue is by setting a touch-action
CSS property. Depending on the type of drags that are handled, you may need touch-action: none
, touch-action: pan-y
, or touch-action: pan-x
.
The
touch-action
setting does not work for iOS yet. While the iOS 9.3 version, which has been released recently, provides limited support,pan-x
andpan-y
do not work. To disable the touch-based scrolling in iOS, prevent thetouchstart
event:
<div ontouchstart="return false">
<div id="my-draggable-element"></div>
</div>
The dragging of elements that contain text activates the browser text selection, which, in most cases, is not desirable. To avoid this behavior, use the user-select: none
CSS property with its respective browser prefixes.
To ignore all touch and pointer events, set mouseOnly
to true
. This is useful when you want to keep the default touch-drag behavior, e.g. horizontal scroll.
import Draggable from '@telerik/kendo-draggable';
const draggable = new Draggable({
mouseOnly: true,
press: function(e) {
console.log("pressed", e.pageX, e.pageY);
},
drag: function(e) {
console.log("drag", e.pageX, e.pageY);
},
release: function(e) {
console.log("release", e.pageX, e.pageY);
}
});
draggable.bindTo(document.getElementById("my-element"));
FAQs
A cross-browser/event abstraction that handles mouse and touch drag sequences
The npm package @telerik/kendo-draggable receives a total of 58,441 weekly downloads. As such, @telerik/kendo-draggable popularity was classified as popular.
We found that @telerik/kendo-draggable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.