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

Changing the Checkbox doesn't update the checked property #23

Open
4 tasks done
mustafasalahuldin opened this issue Feb 11, 2020 · 3 comments
Open
4 tasks done

Comments

@mustafasalahuldin
Copy link

mustafasalahuldin commented Feb 11, 2020

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

I'm using the checkbox element described in this link:
https://demos.creative-tim.com/argon-dashboard-pro/docs/components/forms.html
I expected the checked property to be updated when toggling the checkbox, but for some reason it is not.
I'm using MVC 5 project with Razor syntax.

Current Behavior

No change in the checked property.

also if I use the @HTML.CheckBoxFor() helper method I got duplicate checkbox HTML elements and one of them is hidden:

This the code after compile

<input data-val="true" data-val-required="The TwoFactorEnabled field is required." id="TwoFactorEnabled" name="TwoFactorEnabled" type="checkbox" value="true">
 <input name="TwoFactorEnabled" type="hidden" value="false">
 <span class="custom-toggle-slider rounded-circle" data-label-off="No" data-label-on="Yes">  </span>
 </label>
@rarestoma
Copy link
Contributor

Hi @mustafasalahuldin,

Thank you for working with our products.

It is a mistake that we are going to fix in our next update.

Please change this CSS (.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after) with the following:

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after { background-image: url('data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 8 8\'%3e%3cpath fill=\'%23fff\' d=\'M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z\'/%3e%3c/svg%3e'); }

Please let me know if it works.

All the best,
Rares

@mustafasalahuldin
Copy link
Author

No, sorry, still not working.

No update for the "checked" attribute happened in the checkbox HTML object.
The CSS works fine but the input HTML Input component doesn't update attribute.

@mustafasalahuldin
Copy link
Author

Would you please try it on a sample MVC ASP.net project?

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