You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
ImageMapster currently has sporadic behavior when invoking a method on an element. For example:
Methods can be called on elements that are not yet been initialized - In some cases, the method returns without error (e.g. select) and in some cases there is an error (e.g., keys) but the error is not meaningful (e.g. Uncaught Can't access data until binding complete.).
Methods can be called on unsupported elements (e.g. div)
To Reproduce
Steps to reproduce the behavior:
Open tooltips example
Execute $('.navmenu').mapster('select') in console
Method completes successfully even though div is not a valid target and mapster cannot be applied to it
Execute $('.navmenu').mapster('keys') in console
Method encounters Uncaught Can't access data until binding complete. exception even though div is not a valid target and mapster cannot be applied to it.
Method completes successfully even though mapster is not initialized
Execute $('#testimage').mapster('keys') in console
Method encounters Uncaught Can't access data until binding complete. which is misleading because mapster is not even initialized
Expected behavior
Mapster should only support img/area elements, track initialization and provide meaningful error messages based on situation. Additionally, mapster creates internal elements and there is code in-place that "ignore" these elements during method execution - this additional processing overhead can be avoided by ensuring that mapster is only called on "valid" (user created img/area & initialized) elements.
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
While technically a bug, fixing this properly would result in a breaking change for existing code that uses IM that doesn't follow standard jQuery usage guidelines (wrt to selectors) so it should be saved for next major release and marked as a breaking change.
The text was updated successfully, but these errors were encountered:
techfg
changed the title
Methods can be invoked on non-mapster elements
Methods can be invoked on non-mapster supported/initialized elements
Jan 24, 2021
Describe the bug
ImageMapster currently has sporadic behavior when invoking a method on an element. For example:
select
) and in some cases there is an error (e.g.,keys
) but the error is not meaningful (e.g.Uncaught Can't access data until binding complete.
).div
)To Reproduce
Steps to reproduce the behavior:
$('.navmenu').mapster('select')
in consolediv
is not a valid target and mapster cannot be applied to it$('.navmenu').mapster('keys')
in consoleUncaught Can't access data until binding complete.
exception even thoughdiv
is not a valid target and mapster cannot be applied to it.$('#testimage').mapster('select')
$('#testimage').mapster('keys')
in consoleUncaught Can't access data until binding complete.
which is misleading because mapster is not even initializedExpected behavior
Mapster should only support img/area elements, track initialization and provide meaningful error messages based on situation. Additionally, mapster creates internal elements and there is code in-place that "ignore" these elements during method execution - this additional processing overhead can be avoided by ensuring that mapster is only called on "valid" (user created img/area & initialized) elements.
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
While technically a bug, fixing this properly would result in a breaking change for existing code that uses IM that doesn't follow standard jQuery usage guidelines (wrt to selectors) so it should be saved for next major release and marked as a breaking change.
The text was updated successfully, but these errors were encountered: