Skip to content
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

Move drag blocking to Scroll #2596

Merged
merged 1 commit into from
Apr 26, 2019
Merged

Move drag blocking to Scroll #2596

merged 1 commit into from
Apr 26, 2019

Conversation

alecgibson
Copy link
Contributor

At the moment, consumers cannot enable drag events within the editor,
because they're all disabled by the Quill constructor registering an
anonymous dragstart handler.

This change allows consumers to override this behaviour by moving this
listener to the Scroll blot, where the dragstart is prevented in a
named method, which can be overridden by extending the class.

At the moment, consumers cannot enable drag events within the editor,
because they're all disabled by the `Quill` constructor registering an
anonymous `dragstart` handler.

This change allows consumers to override this behaviour by moving this
listener to the `Scroll` blot, where the `dragstart` is prevented in a
named method, which can be overridden by extending the class.
@jhchen
Copy link
Member

jhchen commented Apr 26, 2019

Great thanks!

@jhchen jhchen merged commit 5b28603 into slab:develop Apr 26, 2019
@alecgibson alecgibson deleted the scroll-drag branch April 27, 2019 14:31
@volser
Copy link

volser commented Aug 18, 2019

@alecgibson @jhchen I have overrided this method and allowed to d&d, but while dragging caret dissapears.
Any ideas what could be? thanks

@alecgibson
Copy link
Contributor Author

It's potentially because the editor is losing focus during the drag? Maybe also related to Selection.handleDragging?

@leo50304
Copy link

leo50304 commented Jan 2, 2024

The reason could also be that you called preventDefault() in a dragover event handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants