-
I am trying to utilize the Preline UI's password toggle component but it is not working, the component looks like this:
The HTML data attribute data-hs-toggle-password would allow the interactivity to occur on click but I suspect that the imported JS module is unable to read the data in the HTML data attribute as it is in a key value form. Other components that utilize the HTML data attribute but pass a string only like Dropdown and Modal work as expected. I have tried to convert the HTML data attribute to JSON then stringified it, changed the format of quotations. I am not entirely sure what is hindering the interactivity but it could be that the HTML data attribute is a JSON. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The v2.0 release of Preline fixes this issue with added support for Typescript, the documentation below provides the necessary steps to: If typescript does not recognize If |
Beta Was this translation helpful? Give feedback.
The v2.0 release of Preline fixes this issue with added support for Typescript, the documentation below provides the necessary steps to:
https://preline.co/docs/frameworks-react.html
If typescript does not recognize
HSStaticMethods.autoInit()
then use// @ts-ignore
.If
import("preline/preline")
throws an error, create a folder named 'types' with a file 'preline.d.ts' in your root project folder. The file will containdeclare module 'preline/preline';