question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AvCheckbox always select all the options

See original GitHub issue

Seems AvCheckboxGroup always select all the options, as long as I give at least 1 value (whatever the value is).

This issue also happens in official example https://availity.github.io/availity-reactstrap-validation/components/avform/

You can try change the options in locationQualities. all the checkboxes will be selected even you only give one of the value e.g. ‘awesome’.

locationQualities: [
        'beautiful',
        'awesome',
        'wonderful',
      ],
          <AvCheckboxGroup inline name="locationQualities" label="Location Qualities" required>
            <AvCheckbox label="Beautiful" value="beautiful" />
            <AvCheckbox label="Awesome" value="awesome" />
            <AvCheckbox label="Wonderful" value="wonderful" />
          </AvCheckboxGroup>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
odlarcommented, Jan 21, 2019

AvCheckbox.prototype.isDefaultChecked = function isDefaultChecked(valueArr) { var _this2 = this;

/*
return Array.isArray(valueArr) && valueArr.length > 0 && valueArr.filter(function (item) {
  return item === _this2.props.value;
});
*/

let dChecked = false; if(Array.isArray(valueArr) && valueArr.length > 0){ for(let i = 0; i < valueArr.length; i ++){ let item = valueArr[i]; if(item === _this2.props.value){ dChecked = true; break; } } } return dChecked; };

2reactions
odlarcommented, Jan 21, 2019

maybe i fix this bug, i modify the AvCheckbox.js file avcheckbox_modify

Read more comments on GitHub >

github_iconTop Results From Across the Web

Availity reactstrap Validation - AvForm
Availity reactstrap Validation - easy to use form validation for reactstrap.
Read more >
How to implement "select all" check box in HTML?
I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be...
Read more >
With in the loop need to write dynamic data to .csv file. What is ...
I have tried with option, but it's allowing me to add only static text. ... so here i need to check current date...
Read more >
test – Badass Moto
@-moz-document url-prefix() { select { padding: 8px; background-position: ... overflow:hidden; -webkit-transition: all .25s; -moz-transition: all .25s; ...
Read more >
Maestro - Documentation
Changing Default Properties on all Sections of a Template ... Colors - components > Field - selected color theme option.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found