baianat / verte

🎨 A Color picker component. Built from the bottom to work with Vue.js.
https://baianat.github.io/verte/
MIT License
181 stars 42 forks source link

Clicking outside the component to close it does not stop the click event #17

Closed wildhart closed 5 years ago

wildhart commented 5 years ago

When clicking outside the component to close it, if you accidentally click on a button then that button's click event is fired.

To Reproduce Steps to reproduce the behavior:

  1. Open the component in display="vertical' mode with a button somewhere else on the page.
  2. Click on the other button.
  3. The component closes but the other button's click event also fires.

Expected behavior Clicking outside a dialogue/popup to close it should not cause any other events.

ismail9k commented 5 years ago

We believe it's a better experience not prevent click event bubbling after the picker menu dismiss.

In a real-world example, if we are using a text editor with two buttons, one for making text bold, and the second is a Verte instant which changes text color. If we select some arbitrary text and change its color using Verte, then want to make it bold, we have to click on the bold button twice, the first click will dismiss Vert's menu then the second will actually fire the bold button.

wildhart commented 5 years ago

OK, I suppose you're right, thank you.