anvaka / panzoom

Universal pan and zoom library (DOM, SVG, Custom)

Home Page:https://anvaka.github.io/panzoom/demo/attach-via-script.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Script attachment options: HTML Attribute Names Not Recognized as Case-Sensitive

dcastillogi opened this issue · comments

I've been working with your library and I noticed an issue regarding the "boundsPadding" or any other attribute using camelCase in HTML Script attachment. In my case, I need to use the "boundsPadding" attribute, which is not recognized as case-sensitive in the browser. This causes the attribute to be displayed as "boundspadding" in the browser, which results in JavaScript not recognizing it when trying to access the attribute using dot notation.

Additionally, the library does not recognize "bounds-padding" or "boundspadding" as valid options to set the bounds padding attribute. This further limits the options for users to set the attribute correctly.

Example:

<script src='https://unpkg.com/panzoom@9.4.0/dist/panzoom.min.js' query='#scene' name='pz' pz-bounds='true'
        pz-autocenter='true' pz-boundsPadding="0.9"></script>

While the "bounds" and "autocenter" attributes are successfully applied to the panzoom, the "boundsPadding" attribute is currently being ignored.