Skip to content
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

Data-binding with Checked in FluentCheckbox and FluentSwitch doesn't work. #131

Closed
marinasundstrom opened this issue Nov 18, 2021 · 5 comments

Comments

@marinasundstrom
Copy link

I assumed that you could do a two-way binding to the Checked property (@bind-Checked) in FluentCheckbox and FluentSwitch. That seemed the most logical - but it did not work. So I tried @bind-Value instead, and then all good.

What is the reason for this? Is it just because of the shared base using Value instead.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Nov 18, 2021

Yes, that is of the shared base using Value

@marinasundstrom
Copy link
Author

@vnbaaij OK. That was a bit confusing. Checked is more semantic.

MudBlazor binds using @bind-Checked for its Toggle control. It also works for EditForm.

I would be more comfortable if both propeties were allowed for data-binding.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Nov 18, 2021

Checked is more semantic yes, but we are following the ASP.NET Core InputCheckbox implementation that also (only) usesValue.
I can see if Checked can be added in a future version.

It also works for EditForm.

Not really sure what you mean here. FluentCheckbox and FluentSwitch work with EditFrom as well...

@marinasundstrom
Copy link
Author

@vnbaaij OK. I'm new to Fluent UI.

Not really sure what you mean here. FluentCheckbox and FluentSwitch work with EditFrom as well...

I actually assumed it worked from looking around. Just pointed out that I thought MudBlazor was more semantic in this regard.

@marinasundstrom
Copy link
Author

To add, I was looking in the sample pages where Checked is used. So that is why I initially assumed it was bindable.

That was the reason for the surprise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants