Comments (2)
I guess the error happens somewhere around here: https://github.com/mdbootstrap/TW-Elements/blob/026a359b473152cc1441d1d5e20e69b60ae348c7/src/js/dom/manipulator.js#L14C7-L14C7
I would maybe use something like this:
if (type === "array") {
return JSON.parse(val);
}
However this would require the type
parameter, that is referenced in the index.js
of the components. The way it is now, it prevents certain attributes. For example one can not set an attribute to a string that only consists of numbers even if the attribute expects a string. Also "false" is always interpreted as a boolean even if the attribute expects a string. This could then be refactored as well.
Would this be appreciated?
from tailwind-elements.
Hi! You are rignt, adding Objects and Arrays inside data attributes does not work at this moment. The best way to set options that contains those two is to do it via JS. We are going to discuss this in our team and decide whether this should be changed.
As of the attributes that consists of numbers or booleans I think it works as it should. Those values should be considered either as a number or as a boolean - if the string inside the data attribute says false
then it should be considered as a boolean value.
Do you have any example where that could create an issue? Maybe I'm missing something.
from tailwind-elements.
Related Issues (20)
- Search - add new docs examples
- Spinners - add new docs examples
- Typography - add new docs examples and theming update
- Background image page HOT 1
- Check components initialization via JS - update/add API tab if needed
- Scrollspy - add missing functionalities
- Fixed Task TWE Standard (mdb 6.4.0)
- Datatable - add additional attributes for tests purposes
- Datatable - fix wrong element & method in PerfectScrollbar usage
- Vue + Inertia, SSR not working, the requested module does not provide HOT 2
- Select Multiple with search and label - after opening dropdown the middle notch has border top
- Animate: remove unnecessary methods
- Autocomplete - add jQuery method & additional attributes for tests purposes
- Datepicker: add jQuery method for tests
- Timepicker: add jQuery method for tests
- Datetimepicker- fixes for tests
- [Select] setValue didn't do anything after filter HOT 4
- Carousel: fix init via JS, jQueryInterface and dispose method HOT 1
- Carousel: Interval not triggered when `ride` option is `true` and slides are manually changed (e.g. via `next` method)
- [input] [moved div element in component in state RTL] HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tailwind-elements.