-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Bug]: Tabs and Resizable components do not work when I set e.preventDefault()
in the pointerdown
function
#847
Comments
@pinky-pig this is by design where we can control the event by |
@zernonia hey 👋 The reason was to develop a drag-and-drop feature compatible with both mobile and web platforms by using pointerEvent instead of mouse and touch in The code was added elsewhere, yet it still caused the shadcn-vue ui component to ineffective. So, it took me a long time to pinpoint the reason.🤣 window.addEventListener('pointerdown', (e) => {
e.preventDefault();
}, false) |
why not in your drag-and-drop feature, only add the listener with |
Environment
Link to minimal reproduction
https://stackblitz.com/edit/9wnv28-rfdbwj?file=src%2FApp.vue
Steps to reproduce
MouseLeftDemo.mp4
Describe the bug
When I set window.addEventListener('pointerdown', function (e){e.preventDefault() }, false) anywhere on the page, clicking on Tabs or Resizable components doesn't respond.
In Radix-Vue TabsTrigger Source Code, I found the use of @mousedown.left. Through a demo, I discovered that setting it up like that indeed doesn't trigger mousedown.left in Vue. As a result, both components don't respond to clicks.
Expected behavior
No response
Context & Screenshots (if applicable)
No response
The text was updated successfully, but these errors were encountered: