Make checks based on state, not conf.value

This commit is contained in:
Ilya Ig. Petrov 2017-05-28 19:05:27 +05:00
parent 88792658aa
commit 32d8e93ddf
4 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,6 @@ export default function getInfoLi() {
.infoRow {
position: relative;
flex-wrap: wrap;
}
.infoRow > input[type="checkbox"] {
position: relative;
@ -119,7 +118,7 @@ export default function getInfoLi() {
const iddy = props.idPrefix + ( props.ifDashify ? camelToDash(props.conf.key) : props.conf.key );
return (
<li class={scopedCss.infoRow + ' horFlex'}>
<li class={scopedCss.infoRow + ' horFlex'} style={ props.children && 'flex-wrap: wrap'}>
<input
type={props.type}
name={props.name}

View File

@ -69,6 +69,7 @@ export default function getMain(theState) {
handleModChange({targetConf, targetIndex, newValue}) {
console.log('NEW VALUE', newValue);
const oldCats = this.state.catToOrderedMods;
const newCats = Object.keys(this.state.catToOrderedMods).reduce((acc, cat) => {

View File

@ -20,10 +20,10 @@ export default function getModList(theState) {
handleCheck(confMeta, ifChecked) {
this.state.checks[confMeta.index] = ifChecked;
if (ifChecked === false || !confMeta.ifChild) {
this.handleNewValue(confMeta, ifChecked);
} else {
console.log('SET STATE', confMeta.index);
this.setState({
checks: this.state.checks.map(
(ch, i) => i === confMeta.index ? ifChecked : ch
@ -63,7 +63,7 @@ export default function getModList(theState) {
conf={conf}
type='checkbox'
name={props.name}
checked={conf.value}
checked={this.state.checks[index]}
key={index}
onChange={(event) => this.handleCheck(confMeta, event.target.checked)}
>

View File

@ -96,7 +96,7 @@ export default function getProxyEditor(theState) {
font-weight: 900;
}
table.editor .export {
padding-right: 2px;
/*padding-right: 2px;*/
}
/* LAST COLUMN: BUTTONS */