-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Open drawer button doesn't work when clicked on the edge #3086
Comments
Thank you @tkgregory
for reporting issues. It helps daisyUI a lot 💚
|
It's not about the drawer, it's about the button click animation. To disable the animation: <button class="btn no-animation">I don't have click animation</button> Or from the theme config:
Let me know if you have a question. |
Thanks for the quick reply @saadeghi . So because the button shrinks on click, the cursor is no longer above the button on release. That means the relevant event doesn't fire. I get this is why it's happening, but could it be useful to fire the event anyway? I mean, from the user perspective they think they clicked the button, right? Should they know the button shrinks before they click on it and therefore not click at the edge? Just wondering what is best from user's perspective. |
Yes, only if the click position is at the very edge pixel of the button which is not common, and if your current daisyUI theme has a
daisyUI is not doing anything about mouse events. daisyUI is just CSS. This happens because mouse down is on the button, the button has a shrink animation and if the click is on the edge of the button, the mouse up is not on the button, so for the browser, it's more like dragging event than a click event since the mouse down and mouse up position is not on the same element. We have this
If you ask my opinion, it's not a common thing for users to click on a edge border of a button and expect it to work. According to UX heatmaps, users usually click on the middle of the button or anywhere on the button text (which is in the middle). If they click on the edge, it's usually not intentional (unless the button is really small and is hard to click on spot) daisyUI provides some built-in themes with opinionated colors, animations, etc it's easy to customize them or even create a new theme. |
Thanks for the added details. I agree it's uncommon to click on the edge of the button, but I did it a few times so it's not impossible. So daisyUI is just CSS. The drawer component is interactive so I thought of wrapping the button in an element that doesn't shrink (to handle the click event). If daisyUI is CSS only, I guess this is not possible. |
What version of daisyUI are you using?
4.12.2
Which browsers are you seeing the problem on?
Brave (Chromium)
Reproduction URL
https://daisyui.com/components/drawer/
Describe your issue
The drawer component has a button that normally opens the drawer when clicked.
When you click at the very edge of the button, the button shrinks as if clicked, but the drawer does not open. This happens every time.
2024-06-17.08-52-08.mp4
I would expect the drawer to open wherever you click on the button.
The text was updated successfully, but these errors were encountered: