vue-fontawesome icon indicating copy to clipboard operation
vue-fontawesome copied to clipboard

Click event is emitted twice after clicking the icon a second time

Open ghost opened this issue 4 years ago • 4 comments

Describe the bug When generating icons in a v-for loop the click event is emitted twice after clicking it the second time.

Reproducible test case https://codesandbox.io/s/summer-cache-th461

Expected behavior A single click should only emit a single click event.

Desktop (please complete the following information):

  • Browser: Google Chrome Version 89.0.4389.128 (Official Build) (x86_64)
  • Vue Font Awesome Version: 3.0.0-3

ghost avatar Apr 23 '21 14:04 ghost

I ran into the same issue. Had to work around it by wrapping it with a div and listening to a click event on that element.

kad-tijhuo avatar Apr 30 '21 08:04 kad-tijhuo

Exact same issue here.

Bug occurred on both 3.0.0-3 and 3.0.0-4.

Deckluhm avatar Jun 04 '21 23:06 Deckluhm

As a best practice, you should use button or link for click action, so that the user can use keyboard to execute the action. You can't use keyboard to click a div or icon.

christhofer avatar Jun 07 '21 02:06 christhofer

Same here. You should use a wrapper element. But still I think it is a bug.

rrd108 avatar Aug 04 '21 17:08 rrd108