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

feat(useDraggable): support customizing trigger element #2133

Merged
merged 1 commit into from Sep 5, 2022

Conversation

imguolao
Copy link
Contributor

@imguolao imguolao commented Aug 26, 2022

Description

Click the handle to drag instead of clicking the entire target to drag.

fixed #1910

Additional context

Whether the trigger handle must be included in the target?


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

class="fixed bg-$vp-c-bg select-none z-10"
:initial-value="{ x: innerWidth / 3.9, y: 240 }"
:prevent-default="true"
handle=".handle"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not so sure about using a selector string here. I would prefer always to accept element instances using template ref.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no opinion. I will romove it, please check the changes.

@imguolao imguolao force-pushed the feat/use-draggable/trigger-handle branch from c0394bb to 357c7ee Compare August 29, 2022 15:45
@antfu antfu changed the title feat(useDraggable): Support trigger handle feat(useDraggable): support customizing trigger element Sep 5, 2022
@antfu antfu enabled auto-merge (squash) September 5, 2022 14:02
@antfu antfu merged commit 33587d1 into vueuse:main Sep 5, 2022
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.

useDraggable支持指定操作元素dom选项
2 participants