fix clicks on post types label not toggling correct checkbox
Currently, all the post types checkbox are being assigned the same "postTypes" id, so clicking on any of the post type labels always toggles the first one. If you inspect the HTML, all the post type labels have 'for="postTypes"' which is how the HTML knows which checkbox to toggle. We have to keep the "name" attribute the same because that's how the checkbox values are linked to the postTypes field. To fix, we explicitly assign the id prop for each checkbox so that the <label>'s "for" attribute is tied to the correct checkbox input.
This commit is contained in:
parent
4789a93778
commit
3328c1daa3
@ -109,6 +109,7 @@ export default function TerritoryForm ({ sub }) {
|
||||
label='links'
|
||||
value='LINK'
|
||||
name='postTypes'
|
||||
id='links-checkbox'
|
||||
groupClassName='ms-1 mb-0'
|
||||
/>
|
||||
</Col>
|
||||
@ -118,6 +119,7 @@ export default function TerritoryForm ({ sub }) {
|
||||
label='discussions'
|
||||
value='DISCUSSION'
|
||||
name='postTypes'
|
||||
id='discussions-checkbox'
|
||||
groupClassName='ms-1 mb-0'
|
||||
/>
|
||||
</Col>
|
||||
@ -127,6 +129,7 @@ export default function TerritoryForm ({ sub }) {
|
||||
label='bounties'
|
||||
value='BOUNTY'
|
||||
name='postTypes'
|
||||
id='bounties-checkbox'
|
||||
groupClassName='ms-1 mb-0'
|
||||
/>
|
||||
</Col>
|
||||
@ -136,6 +139,7 @@ export default function TerritoryForm ({ sub }) {
|
||||
label='polls'
|
||||
value='POLL'
|
||||
name='postTypes'
|
||||
id='polls-checkbox'
|
||||
groupClassName='ms-1 mb-0'
|
||||
/>
|
||||
</Col>
|
||||
|
Loading…
x
Reference in New Issue
Block a user