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

onClick on tiles is triggered twice #1636

Closed
ngirot opened this issue Sep 27, 2020 · 5 comments
Closed

onClick on tiles is triggered twice #1636

ngirot opened this issue Sep 27, 2020 · 5 comments

Comments

@ngirot
Copy link

ngirot commented Sep 27, 2020

Describe the bug
I mixed metro-ui with react, and i tried to add an onClick event on a tile.
The issue is that the onclick event is triggered twice.

To Reproduce
https://codepen.io/ngirot/pen/JjXVGER

There is two item, triggered the same increment function

  • one is triggered once (the one on the button)
  • the second is triggered twice (the one on the tile)

Expected behavior
The onClick event should be triggered once.

Desktop (please complete the following information):

  • OS: Linux Fedora
  • Browser Firefox 81.0
  • Metro Version 4.3.2
@olton
Copy link
Owner

olton commented Sep 28, 2020

use attribute data-on-click. https://codepen.io/olton/pen/xxVegJK

@olton olton closed this as completed Sep 28, 2020
@ngirot
Copy link
Author

ngirot commented Sep 28, 2020

The bug comes from the mix between metro & React, if you remove React, yeah, it works...
So, maybe I didn't understand your answer, but if I use 'data-on-click' on my codepen, it doesn't increment the counter at all.

@olton olton reopened this Sep 28, 2020
olton added a commit that referenced this issue Sep 28, 2020
…ick` renamed to `onTileClick` (attribute `data-on-click` => `data-on-tile-click`), issue #1636
@olton
Copy link
Owner

olton commented Sep 28, 2020

Fixed in 4.4.1

  • Tile: fixed double firing click event. Component internal event onClick renamed to onTileClick (attribute data-on-click => data-on-tile-click)

@olton
Copy link
Owner

olton commented Sep 28, 2020

@olton olton added this to the 4.4.1 milestone Sep 28, 2020
@olton olton added the Fixed label Sep 28, 2020
@ngirot
Copy link
Author

ngirot commented Sep 29, 2020

The 4.4.1 version fixed my issue. Thank you very much for your fix and responsiveness.

@ngirot ngirot closed this as completed Sep 29, 2020
olton added a commit that referenced this issue Oct 28, 2023
…ick` renamed to `onTileClick` (attribute `data-on-click` => `data-on-tile-click`), issue #1636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants