helgatheviking / Radio-Buttons-for-Taxonomies

Turn any WordPress taxonomy into a list of radio buttons, which forces users to select only 1 term!
53 stars 28 forks source link

[dev] Fix odd click behavior #51

Closed leymannx closed 5 years ago

leymannx commented 5 years ago

I checked out the dev branch for WP5 compatibility and radios appear nicely for the chosen taxonomies.

But odd is, when clicking the radios for the first time, I need to click them twice to actually select them. This only happens when clicking them the first time after document ready.

I'd expect the radios get selected just at the first click.

helgatheviking commented 5 years ago

Thanks for the report @leymannx . I'd seen dodgy behavior on clicks some of the time too, but haven't been able to pin it down yet.

indextwo commented 5 years ago

I've only taken a super-quick look at this, but I can reproduce it consistently in both latest versions of FF & Chrome under Win10:

Clicking on the actual radio button input results in it not changing, either visually or in its actual state, no matter how many times it's clicked (confirmed by console-logging its checked value). Clicking the label for said input will change it as expected every time.

helgatheviking commented 5 years ago

I kinda think a lot of these issues are related to needing to set the state. I was still thinking in PHP that all the form inputs are serialized and submitted to save, but that's not the case in gutenberg.

leymannx commented 5 years ago

Also fixed with #53 I'd say.