Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay form (properties) duplicates element ids #578

Closed
jensens opened this issue Jul 20, 2023 · 4 comments
Closed

Overlay form (properties) duplicates element ids #578

jensens opened this issue Jul 20, 2023 · 4 comments

Comments

@jensens
Copy link
Member

jensens commented Jul 20, 2023

The IDs are duplicated which results into problems. IDs have to be unique by HTML specification.

Known problem: The ordered select input widget is broken currently.
It uses document.getElementById with the IDs of the current widget. Instead of finding the active form element it get the hidden one. This result in an error message (alert) on click: "Must select something!".

@gogobd
Copy link
Contributor

gogobd commented Jul 20, 2023

Maybe it is possible to prefix the original ids with something during the duplication and un-prefix them when the temporary copy is being closed. Probably that "duplication action" happening in patterns and the problem's there. "setup_vivibility" might be a good spot to make it work. The events "hide", "hidden" looked promising, too.

@jensens
Copy link
Member Author

jensens commented Jul 21, 2023

@petschki What do you think?

@petschki
Copy link
Member

Instead of fiddling around with the duplicated @@edit form in the modal (which is loaded via AJAX) I have tried to use the original hidden form inside .mosaic-original-content as modal content for manipulation. But pat-plone-modal always clones the modal content so you have duplicated IDs anyways.
I also thought about getting rid of pat-plone-modal and use native html dialog elements, but that leads to even more problems with patterns loaded inside the dialog. long story short: cleanest solution IMHO would be to use the hidden form as modal content, manipulate it and hide it again.

@petschki
Copy link
Member

petschki commented Aug 8, 2023

Duplicated Element IDs is solved in #577 ... orderedselectwidget could need some love though plone/plone.app.z3cform#184

@petschki petschki closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants