mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
[FIX] Select label on tags works like checkbox
This commit is contained in:
committed by
Franc Camps-Febrer
parent
58bbc23f82
commit
8bf4e6c775
@@ -1,9 +1,9 @@
|
||||
import '../scss/main.scss';
|
||||
import React from 'react';
|
||||
|
||||
export default ({ label, isActive, onClickLabel, onClickCheckbox }) => (
|
||||
export default ({ label, isActive, onClickCheckbox }) => (
|
||||
<div className={(isActive) ? 'item active' : 'item'}>
|
||||
<span onClick={() => onClickLabel()}>{label}</span>
|
||||
<span onClick={() => onClickCheckbox()}>{label}</span>
|
||||
<button onClick={() => onClickCheckbox()}>
|
||||
<div className="checkbox" />
|
||||
</button>
|
||||
|
||||
@@ -53,7 +53,6 @@ class TagFilter extends React.Component {
|
||||
<Checkbox
|
||||
isActive={this.isActive()}
|
||||
label={label}
|
||||
onClickLabel={() => this.onClickTag()}
|
||||
onClickCheckbox={() => this.onClickTag()}
|
||||
/>
|
||||
</li>
|
||||
@@ -73,7 +72,6 @@ class TagFilter extends React.Component {
|
||||
<Checkbox
|
||||
isActive={this.isActive()}
|
||||
label={`${category.name} ( ${category.counts} )`}
|
||||
onClickLabel={() => this.onClickCategory()}
|
||||
onClickCheckbox={() => this.onClickCategory()}
|
||||
/>
|
||||
</li>
|
||||
|
||||
@@ -30,7 +30,7 @@ class TagListPanel extends React.Component {
|
||||
|
||||
if (Object.keys(tagFilter.children).length > 0) {
|
||||
Object.values(tagFilter.children).forEach((childNode) => {
|
||||
this.traverseNodeAndCheckIt(childNode, depth, tagFilters, tagFilter.active);
|
||||
this.traverseNodeAndCheckIt(childNode, depth, tagFilter.active);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user