img-mapper / react-img-mapper

React Component to highlight interactive zones in images
https://img-mapper.github.io/react-docs
MIT License
122 stars 39 forks source link

Disable areas hover #77

Closed maple146 closed 10 months ago

maple146 commented 11 months ago

Is your feature request related to a problem? Please describe. Hello! I'm creating a game to find the differences between two images with this library. The problem is that when I hover the mouse over an area, the hover style spoils the answer.

Describe the solution you'd like I would like to know if there's any way to hide or delete the hover styles of the map areas and also keep the styles of the shapes after clicking on them.

Describe alternatives you've considered I've tried using the .img-mapper-map class and targeting the area but it didn't work.

My guess was that doing something like this would disable the styles, but the only property that worked was the pointer one:

.img-mapper-map {
  area:hover {
    cursor: pointer;
    fill: rgba(255, 255, 255, 0.0);
    border-color: rgba(255, 255, 255, 0.0);
    border: none;
    border-style: none;
    background: rgba(255, 255, 255, 0.0);
    background-color: rgba(255, 255, 255, 0.0);
  }
}

Additional context game

NishargShah commented 10 months ago

Hello @maple146, I didn't get the actual problem, can you please explain this in detail and please check the active prop if it resolve your issue

maple146 commented 10 months ago

Hi @NishargShah! Sorry for the lack of clarity in the question. What I wanted was to disable this hover effect when I'm hovering over an area: hover effect

I couldn't disable the hover effect without disabling the active area style, so I ended up implementing it another way. Thank you for your time!