Skip to content

@bind-value doesn't work correctly with globalization features #12631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rynowak opened this issue Jul 26, 2019 · 1 comment
Closed

@bind-value doesn't work correctly with globalization features #12631

rynowak opened this issue Jul 26, 2019 · 1 comment
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed

Comments

@rynowak
Copy link
Member

rynowak commented Jul 26, 2019

These two work differently:

<input type="number" @bind="numberNumber" />
<input type="number" @bind-value="numberNumber" />

@bind is aware of the fact that we're using a culture-invariant field and will pass the invariant culture into the binding.

However, @bind-value isn't doing this.


The fix is to add two additional mappings to BindAttributes

    [BindInputElement("date", "value", "value", "onchange", true, "yyyy-MM-dd")]
    [BindInputElement("number", "value", "value", "onchange", true, null)]
@rynowak rynowak added bug This issue describes a behavior which is not expected - a bug. area-blazor Includes: Blazor, Razor Components labels Jul 26, 2019
@rynowak rynowak added this to the 3.0.0-preview8 milestone Jul 26, 2019
@rynowak rynowak self-assigned this Jul 26, 2019
rynowak pushed a commit that referenced this issue Jul 27, 2019
Fixes: #12631

These mappings were missing and adding them restores the correct
behaviour. Mixing up the usage of `@bind` vs `@bind-value` so we have
more coverage of this.
rynowak pushed a commit that referenced this issue Jul 28, 2019
Fixes: #12631

These mappings were missing and adding them restores the correct
behaviour. Mixing up the usage of `@bind` vs `@bind-value` so we have
more coverage of this.
@AlexKovynev
Copy link

push commit guys:)

rynowak pushed a commit that referenced this issue Jul 30, 2019
Fixes: #12631

These mappings were missing and adding them restores the correct
behaviour. Mixing up the usage of `@bind` vs `@bind-value` so we have
more coverage of this.
rynowak pushed a commit that referenced this issue Jul 30, 2019
Fixes: #12631

These mappings were missing and adding them restores the correct
behaviour. Mixing up the usage of `@bind` vs `@bind-value` so we have
more coverage of this.
@rynowak rynowak added Done This issue has been fixed and removed Working labels Jul 30, 2019
@rynowak rynowak closed this as completed Jul 30, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed
Projects
None yet
Development

No branches or pull requests

2 participants