Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

$mdGesture: problems with drag events #11204

Open
chenlijun99 opened this issue Mar 31, 2018 · 3 comments
Open

$mdGesture: problems with drag events #11204

chenlijun99 opened this issue Mar 31, 2018 · 3 comments
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P3: important Important issues that really should be fixed when possible. type: gestures ui: mobile
Milestone

Comments

@chenlijun99
Copy link
Contributor

chenlijun99 commented Mar 31, 2018

Bug

By registering a event listener with this:

$mdGesture.register(element, 'drag', { horizontal: true });

I encountered following problems:

  • Texts get selected when dragging over them. This means that after the "$md.dragend", I won't be able to initialize another "$md.dragstart" since there is some text selected.
  • When I try to drag in mobile emulation and the pointer is over a text block, when "$md.drag" event is triggered only few times or even not triggered at all.

What is the expected behavior?

  • Text selection should be prevented when dragging
  • Mobile drag should work even on text block

What is the current behavior?

  • Text selection when dragging isn't prevented
  • Dragging over text blocks in mobile doesn't work as expected

CodePen and steps to reproduce the issue:

CodePen Demo which shows your issue:
Detailed Reproduction Steps:
  • Try to press the mouse and start dragging. Go over the text block. Some text is selected.
    Release the mouse and try to drag again.
  • Go in mobile simulation mode and try to drag with the pointer over the text-block.
    "$md.drag" is fired only few times.

Note: the number is the yellow area represents the times "$md.drag" is fired.

What is the use-case or motivation for changing an existing behavior?

Which versions of AngularJS, Material, OS, and browsers are affected?

Angular material 1.1.8
Angularjs 1.6.9
Google Chrome Version 63.0.3239.108 (Official Build) (64-bit)

Is there anything else we should know? Stack Traces, Screenshots, etc.

@Splaktar Splaktar added type: gestures ui: mobile P3: important Important issues that really should be fixed when possible. for: external contributor labels Apr 5, 2018
@Splaktar Splaktar added this to the 1.1.10 milestone Apr 5, 2018
@Splaktar Splaktar added the needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community label Apr 5, 2018
@Splaktar
Copy link
Member

Splaktar commented Apr 5, 2018

Have you tried the following?

      angular.module('MyApp', ['ngMaterial', 'ngMessages'])
      .config(function($mdGestureProvider) {
        // For mobile devices without jQuery loaded, do not
        // intercept click events during the capture phase.
        $mdGestureProvider.skipClickHijack();
      });

@chenlijun99
Copy link
Contributor Author

I've added it to the CodePen.
It still doesn't work though.

@Splaktar
Copy link
Member

Splaktar commented Apr 7, 2018

OK, thanks for giving it a shot.

@Splaktar Splaktar modified the milestones: 1.1.10, 1.1.11 Jun 19, 2018
@Splaktar Splaktar modified the milestones: 1.1.11, 1.1.12 Sep 10, 2018
@Splaktar Splaktar modified the milestones: 1.1.12, 1.1.13 Jan 3, 2019
@Splaktar Splaktar modified the milestones: 1.1.13, 1.1.14 Feb 10, 2019
@Splaktar Splaktar modified the milestones: 1.1.14, 1.1.15 Mar 14, 2019
@Splaktar Splaktar modified the milestones: 1.1.15, 1.1.16, 1.1.18, 1.1.19 Mar 29, 2019
@Splaktar Splaktar modified the milestones: 1.1.19, 1.1.21 May 30, 2019
@Splaktar Splaktar modified the milestones: 1.1.21, 1.1.22 Aug 15, 2019
@Splaktar Splaktar modified the milestones: 1.1.22, 1.1.23 Oct 22, 2019
@Splaktar Splaktar modified the milestones: 1.1.23, 1.2.1 May 6, 2020
@Splaktar Splaktar modified the milestones: 1.2.1, 1.2.2 Sep 14, 2020
@Splaktar Splaktar modified the milestones: 1.2.2, - Backlog Oct 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P3: important Important issues that really should be fixed when possible. type: gestures ui: mobile
Projects
None yet
Development

No branches or pull requests

2 participants