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

fix(cdk/drag-drop): make sure event is cancelable before calling "preventDefault" #28825

Merged
merged 1 commit into from Apr 6, 2024

Conversation

rosostolato
Copy link
Contributor

Fixes #18296

If you set a value for dragStartThreshold greater than 0, it will throw console errors saying: "[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted."

@Component({
  standalone: true,
  selector: 'app-carousel',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [CdkDrag],
  providers: [
    {
      provide: CDK_DRAG_CONFIG,
      useValue: {
        dragStartThreshold: 20,
      },
    },
  ],

image

Adding a condition to check if the event is cancelable will prevent that error.

…Default"

If you set a value for `dragStartThreshold` greater than 0, it will throw console errors saying: "[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted."

Fixes angular#18296
Copy link

google-cla bot commented Apr 4, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@crisbeto crisbeto self-assigned this Apr 5, 2024
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed labels Apr 5, 2024
@rosostolato rosostolato changed the title fix(drag-drop): make sure event is cancelable before calling "prevent Default" fix(cdk/drag-drop): make sure event is cancelable before calling "prevent Default" Apr 5, 2024
@rosostolato rosostolato changed the title fix(cdk/drag-drop): make sure event is cancelable before calling "prevent Default" fix(cdk/drag-drop): make sure event is cancelable before calling "preventDefault" Apr 5, 2024
@crisbeto crisbeto merged commit da302d2 into angular:main Apr 6, 2024
22 of 26 checks passed
crisbeto pushed a commit that referenced this pull request Apr 6, 2024
…ventDefault" (#28825)

If you set a value for `dragStartThreshold` greater than 0, it will throw console errors saying: "[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted."

(cherry picked from commit da302d2)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed target: patch This PR is targeted for the next patch release
Projects
None yet
3 participants