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

Navigate URL used inconsistent between onClick & clickNavigate #352

Closed
techfg opened this issue Jan 24, 2021 · 0 comments · Fixed by #354
Closed

Navigate URL used inconsistent between onClick & clickNavigate #352

techfg opened this issue Jan 24, 2021 · 0 comments · Fixed by #354
Labels
Milestone

Comments

@techfg
Copy link
Collaborator

techfg commented Jan 24, 2021

Describe the bug
ImageMapster provides two different ways to navigate to a URL when an area is clicked:

  1. onClick Handler - When onClick is defined and return value is true, IM will navigate to the href defined on the AREA element that was clicked
  2. clickNavigate - When clickNavigate is true, IM uses the AreaData href which may or may not be the href of the AREA element that was clicked on as AreaData href will contain the href defined by the first AREA element that contained the given mapKey.

To Reproduce
Steps to reproduce the behavior:

Note that navigation within the fiddle will always fail since the destination doesn't permit iFrames. Hover over the error to see which page was attempted to be loaded

  1. Open jsFiddle
  2. Click on George (last guy on right)
  3. Navigation attempts to go to microsoft.com as defined by Paul href which is the first area defined for mapKey beatles
  4. Set clickNavigate to false in the fiddle
  5. Re-run fiddle
  6. Click on George
  7. Navigation attempts to go to yahoo.com as defined by George href

Expected behavior
Navigation href should be consistent regardless of which approach triggered the navigation. When/Where Mapster uses area element props vs AreaData props is not well defined and inconsistent (separate issue). For this particular situation, the resolution of href should be Area element that was clicked on then AreaData is Area doesn't have an href.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

techfg added a commit that referenced this issue Jan 25, 2021
Resolves #352, Resolves #353 - add navigationMode option
@techfg techfg added the bug label Jan 25, 2021
@techfg techfg added this to the 1.5.0 milestone Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant