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

Scheduler drag and drop with mobile support #1395

Merged
merged 5 commits into from
Mar 21, 2024
Merged

Conversation

V45370
Copy link
Contributor

@V45370 V45370 commented Feb 27, 2024

All issues should be resolved now. Tested touch support on Android and on Chrome dev tools for mobile.
Had to use DragDropTouch.js with a little modification described here
It is currently added as a separate DragDropTouch.js file, but you might want to integrate it inside Radzen.Blazor.js

Поздрави

@akorchev
Copy link
Collaborator

Had to use DragDropTouch.js with a little modification described Postlagerkarte/blazor-dragdrop#147 (comment)

I am afraid we can't accept a PR that introduces a third party js dependency. And just including the file in Radzen.Blazor.js isn't an option either - both license wise and size-wise. Radzen already includes drag and drop implementations and we don't want another one - RadzenSlider, RadzenColorPicker and RadzenDialog use drag and drop.

@V45370
Copy link
Contributor Author

V45370 commented Feb 27, 2024

In this case, I will investigate further

@akorchev
Copy link
Collaborator

I think HTML5 drag and drop works out of the box on latest mobile devices. That's what this page claims https://caniuse.com/dragndrop

Perhaps the implementation you suggested needs a little tweaking to make it work on a mobile device (without a polyfil or a brand new drag and drop implementation).

@V45370
Copy link
Contributor Author

V45370 commented Feb 28, 2024

Thanks for the suggestion. I will look into it. However the reason I decided to use the third-party implementation was because, it fixes the ontouchend event firing and the dragging animation.
Does it mean that I need to figure a way without modifying the Radzen.Blazor.js or I can add a method or two if needed?

@akorchev
Copy link
Collaborator

You can add a method or two if needed to Radzen.Blazor.js. Also check if some of the existing code would help - there is drag and drop in the splitter, datagrid, slider, dialog etc.

@akorchev
Copy link
Collaborator

I think I've completed the implementation - removed touch events and the polyfill. It seems setting ondragstart as a string was the only thing required to enable drag and drop on mobile devices.

@akorchev akorchev merged commit b88156a into radzenhq:master Mar 21, 2024
1 check passed
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.

None yet

2 participants