-
Notifications
You must be signed in to change notification settings - Fork 220
CheckboxControl: stop using Gutenberg's CheckboxControl to avoid duplicated ID's #2097
Comments
The issue seems to be because we use two different versions of My first idea to solve this would be to try to upstream a change in Gutenberg so
|
is it the version we're enqueueing that is using |
I don't think our direct usage of
I can't think of any easy solution other than trying to hardcode ids for the conflicting elements. |
Hmm ya we've hit one of the potential problems we'll face by loading two different sources for packages on the same route. One suggestion I have is to use webpack alias |
This seems like the most preferable approach granted that all of our editor code should depend on the external for that to work, mismatched versions in the editor will create issues since sometimes an update in a package is reflected in all packages and they're published together. |
Correct me if I'm wrong but one of the reasons we are using an aliased version of |
That's a good point that I forget, regarding this point, looking at the current state of things, I'm really thinking of doing a refactor for our components and removing This however, should wait until cooldown to see if we should do this or we can see a way out of this. |
Oh right. Is this issue only affecting checkbox controls? If so, then it's probably because we import checkbox control for the block. If we don't import WP's checkbox control and just build our own (ugh, but if unavoidable), would that fix? If this affects all controls then we have a larger problem. |
So you're right, the only affected component is the I updated the title of this issue accordingly. |
Uh oh!
There was an error while loading. Please reload this page.
To Reproduce
#inspector-checkbox-control-5
(the number might be different) in the inspector devtools.This is causing some checkboxes not to be actionable through the

<label>
:The text was updated successfully, but these errors were encountered: