ImageMapster icon indicating copy to clipboard operation
ImageMapster copied to clipboard

onClick event will not fire if `clickNavigate` is set to `true`

Open reydelleon opened this issue 10 years ago • 1 comments

First of all, thanks for such an awesome and very complete plugin. It saved me a lot of work!

Recently, I spent some time trying to find out why the onClick was not firing. It turns out that this will happen whenever clickNavigate is set to true. I don't know if this is a desired behavior or not. If it is, then I would suggest a brief note be included in the docs to point this out. If it's not, then I hope this issue serves to bring it up so it be fixed.

reydelleon avatar Apr 26 '15 16:04 reydelleon

Hello @reydelleon -

Thank you for your feedback, apologies for the delayed reply!

This is expected behavior in the current version as the intent of clickNavigate === true would be to navigate to a URL in which case, the page itself is changing so there typically wouldn't be a need to further execute onClick function.

With that said and as of v1.5.0, IM now has a navigateMode parameter which changes the previous behavior of always navigating in the current window and allowing navigation to occur in other targets (e.g. _blank, iframe, etc.). GIven this, there could be scenarios where it would be beneficial to still invoke onClick even when clickNavigate is true.

Marking this as a new feature and also noting that regardless of decision, the docs should be updated to reflect the expected bevhior.

Thank you again!

techfg avatar Jan 30 '21 23:01 techfg