htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
Other
4.9k stars 309 forks source link

Can't pass a function in data-hs-file-upload for Upload File component #495

Open ahmedkhabar opened 2 weeks ago

ahmedkhabar commented 2 weeks ago

Summary

I used the File Upload example code and when I want to add success function in the data-hs-file-upload configuration obj I face a problem while passing a function because JSON.stringify and JSON.parse doesn't support functions, I suggest to use JSONfn [http://www.eslinstructor.net/jsonfn] instead.

Steps to Reproduce

  1. Open Demo Link
  2. Uncomment the JSON approche & comment to JSONfn approche

Demo Link

https://stackblitz.com/edit/vitejs-vite-67svyt?file=index.html&terminal=dev

Expected Behavior

Passing call backs in data-hs-file-upload for Upload File component without a problem

Actual Behavior

an errro said that success is not a function

Screenshots

No response