5ally / my-term-selector

6 stars 3 forks source link

Doesn't limit saving to one term #1

Closed helgatheviking closed 5 years ago

helgatheviking commented 5 years ago

In my implementation of this, I'm finding that changing the input type to radio (by itself) doesn't seem to restrict the post to saving only 1 term. https://github.com/helgatheviking/Radio-Buttons-for-Taxonomies/issues/53 I'm guessing that's because the entire form is not posted like a traditional html form. I looked at the core radio component and there's a state that's set that we're not yet doing. I think that's also related to the odd clicking behavior I'm seeing here https://github.com/helgatheviking/Radio-Buttons-for-Taxonomies/issues/51

Have you seen either of those in your version?

5ally commented 5 years ago

Sorry @helgatheviking, I missed your message again. (Not watching this repo..)

But I'm not having any of those issues - clicking the radio buttons work fine and only one term is saved - please try this sample plugin: wpse-332513.zip wpse-332513.zip.

Or check https://github.com/5ally/my-term-selector/tree/master/wpse-332513.

(You'll have to temporarily disable your plugin.)

5ally commented 5 years ago

Perhaps you can compare your (copy of the original) HierarchicalTermSelector component with mine? :)

https://github.com/5ally/my-term-selector/blob/master/src/my-term-selector.js

helgatheviking commented 5 years ago

@5ally no worries! I appreciate any insight you have on this whenever you manage to send it. I think a file diff would be a great idea and will try to get to that soonish.

helgatheviking commented 5 years ago

A diff reveals quite a few more changes than I originally was aware of: https://www.diffchecker.com/e3ZVXG1K

Applying the rest of your changes does appear to correctly limit the saving to a single term. Yes!

5ally commented 5 years ago

Hey @helgatheviking, I'm so glad to hear that! All the best. :)