studiometa / ui

📦 A set of opiniated, unstyled and accessible components
https://ui.studiometa.dev/-/
MIT License
10 stars 1 forks source link

[DataBind] Add support for casting value when accessing it #266

Open titouanmathis opened 3 months ago

titouanmathis commented 3 months ago

The DataBind component does not have yet a special handling of values, except for checkboxes and selects.

It could be useful to be able to define the type of the value that should be returned when invoking the get() method or reading the value property.

If we are dealing with inputs of type number for example, it can not be used as follows:

dataBindInstance.value += 1;
titouanmathis commented 1 month ago

We have 2 options :