Skip to content

Custom binding handlers - bind|commaSeparatedDecimal:value - bind|commaSeparatedTags:value - etc #6960

@agrinei

Description

@agrinei

Describe the problem

Currently we can use inpút type number to bind to decimal numbers but browser support is inconsistent regarding different locales and decimal separators.

Describe the proposed solution

It would be nice to be able to customize the binding process using custom binding handlers as shown below:

<input type="text" bind|commaSeparatedDecimal:value={someDecimalNumber} />

The (two way) binding handler should be able to check the element kind (html input, svelte component, etc), attach event handlers to limit allowed characters and provide formatting as well.

This could be useful in many other scenarios:

<input type="text" bind|commaSeparatedTags:value={tagsArray} />

Alternatives considered

I thing the current alternative is to use a different property for the binding, but I might be wrong.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions