img-mapper/react-img-mapper

onClick works one time

Closed this issue · 2 comments

Describe the bug A clear and concise description of what the bug is.
I want to use a function if I am clicking on an area.
The first time the function will be used. After clicking on the other area, nothing happend.

At the screenshot you can see: Postit, keyboard and desktop is marked.

in the console only one time shows the log message "Logging a message!'", It should be everytime if I am click on the different area. Do you have a solution?

To Reproduce Steps to reproduce the behavior:

  1. Go to the page, hover on all the polygons
  2. Click on a polygon
  3. Console output shows right
  4. After clicking on another polyigon the output don't show up

grafik

Desktop (please complete the following information):

  • OS: Linux, arch
  • Browser: firefox
  • Version: latest

Additional context Add any other context about the problem here.
I use for usually typescript.

const logMessage = () => {
    console.log('Logging a message!');
};

<ImageMapper src={URL} map={MAP} stayMultiHighlighted={true} onClick={logMessage}/>

Hello @geeflaxx, can you please provide the example in code sandbox? and if possible, please use the latest version https://www.npmjs.com/package/react-img-mapper/v/2.0.0-alpha.3

Due to no example from the @geeflaxx, I am closing it.