mdb-checkbox validating doesn't work


Topic: mdb-checkbox validating doesn't work

bitmads pro premium asked 5 years ago

Actual behavior

Currently, when I check in then check out a required mdb-checkbox the validating stop working. It should be updated.

  1. After page load, the control.errors.required is true: https://i.imgur.com/mPngTkS.png
  2. Check-in the checkbox, control.errors is null as excepted: https://i.imgur.com/IJpfypW.png
  3. Thick-off the checkbox, the control.errors.required should be true again, but it's still null, meaning, it passes the validation despite that the checkbox is required and unchecked: https://i.imgur.com/wSfbwn1.png

Expected behavior

When I thick off a required mdb-checkbox, it shouldn't pass the validation. The control.errors.required should be true.

Resources (screenshots, code snippets etc.)


Arkadiusz Idzikowski staff answered 5 years ago

You should use requiredTrue validator instead of required for checkboxes.


bitmads pro premium commented 5 years ago

I've tried of course and got the same result. As a premium user, I'm very very disappointed in MDB Pro, there are many many issues with the angular version, you released that before you'd be sure it's working well on Angular way.

Also, I'm unsatisfied with the support. I'm always getting half/invaluable/unrelated answers after waiting 24 hours, then when I ask again, nobody answers anymore. Terrible support, alpha code sold as premium.


Arkadiusz Idzikowski staff answered 5 years ago

We were getting the same results with required validator, but everything seems to be working fine when we use requiredTrue (like in the example from our documentation).

checkbox: new FormControl(true, Validators.requiredTrue),

https://mdbootstrap.com/docs/angular/forms/validation/#other-components

Could you show us your implementation of this form control?

The speed and quality of our response often depend on the information provided by the author of the topic, because we need to reproduce the problem as accurately as possible on our end.


bitmads pro premium commented 5 years ago

Thank you, it's working now, there's some another mysterious bug around the form elements. Interesting but sometimes the checkbox stayed the normal HTML checkbox (not the pro material design) sometimes it appeared well. It depended on what form element was before.I don't have time to investigate this bug now.

Now the next problem is:https://i.imgur.com/kkjUq7m.png


Arkadiusz Idzikowski staff answered 5 years ago

Unfortunately we couldn't reproduce the bug with material styles. Does it happen in some specific circumstances?

Thank you for reporting the problem with the position of checkbox validation messages. We will fix that as soon as possible, for now as a workaround please add a custom class to the mdb-error and mdb-success components and move it manually with css styles. For example:

.checkbox-msg {
    top: 85px !important;
}

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: 8.1.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes