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

$mdGesture: problems with drag events #11204

Description

@chenlijun99

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.

Activity

  1. added this to the 1.1.10 milestone on Apr 5, 2018
  2. added
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    on Apr 5, 2018
  3. Splaktar commented on Apr 5, 2018

    @Splaktar
    Contributor

    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();
          });
  4. chenlijun99 commented on Apr 5, 2018

    @chenlijun99
    ContributorAuthor

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

  5. Splaktar commented on Apr 7, 2018

    @Splaktar
    Contributor

    OK, thanks for giving it a shot.

  6. modified the milestones: 1.1.10, 1.1.11 on Jun 19, 2018
  7. modified the milestones: 1.1.11, 1.1.12 on Sep 10, 2018
  8. modified the milestones: 1.1.12, 1.1.13 on Jan 3, 2019
  9. 6 remaining items

  10. modified the milestones: 1.1.18, 1.1.19 on Apr 1, 2019
  11. modified the milestones: 1.1.19, 1.1.21 on May 30, 2019
  12. modified the milestones: 1.1.21, 1.1.22 on Aug 15, 2019
  13. modified the milestones: 1.1.22, 1.1.23 on Oct 22, 2019
  14. modified the milestones: 1.1.23, 1.2.1 on May 6, 2020
  15. modified the milestones: 1.2.1, 1.2.2 on Sep 14, 2020
  16. modified the milestones: 1.2.2, - Backlog on Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: importantImportant issues that really should be fixed when possible.needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or communitytype: gesturesui: mobile

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions