-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programatic cancelling of a drag #9
Comments
For now you can do this by triggering an 'escape' keydown event on the window const triggerEscape = () => {
const event = new window.KeyboardEvent('keydown', {
bubbles: true,
cancelable: true,
keyCode: 27,
});
window.dispatchEvent(event);
}
triggerEscape(); |
Hey @alexreardon, I am having trouble using the above code snippet. In typescript, the interface for As per the MDN docs, https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode |
The code I listed is just a work around. You can trigger an escape key press however you like. While |
This might be possible as a part of work relating to #1225 |
Once a drag has started there is no way to cancel it except through user input. There may be a scenario where the application wants to clear any current drag
The text was updated successfully, but these errors were encountered: