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
[BOGUE] validation de formulaire sans ruiner/casser les événements ajoutés par d'autres javascript #9498
Comments
Je travail là dessus. |
Il fonctionne comme prévu avec la bibliothèque wet-boew v4.0.50. |
Certain types de champs ont ce problème, d'autres comme text input n'ont pas de problème. |
**wb-frmvlid of the wet-boew removes the events (change & state:checked) and events (change & state:value & keyup) from the field checkbox and radio type in Webform, respectively. It breaks the conditional functionality of Webform. To fix this issue, the wet-boew library could carefully use namespaces for adding (.on) and removing (.off) it's wb-frmvld related form events instead of removing elements just reset it's own namespaced events as needed, avoid changing non-namespaced events like change and keyup events and state:checked attribute just remove the eventname.namespace event , preventing the breaking of other modules functionality and basically avoid being a poor partner of the rest of the web. Example of a better approach: https://api.jquery.com/event.namespace/ with that said, I think the problem is that the wb-frmvld functionality is removing the elements and their events , moving things around and rebuilding them from scratch without their original events. I looked at the wet-boew source code just now, nothing obvious other than elements removed and added to the dom not sure what else could be causing this because I don't see the use of .off at all, unless there's another equivalent method I'm not familiar with. |
Thanks to @nancy-hebert for this, the build and compile instructions are here: https://wet-boew.github.io/v4.0-ci/docs/start-en.html I haven't tested these build/compile instructions yet but it's a good starting point. If anyone wants to attempt to help fix this you'll need the compile instructions to build test code for wet-boew.js. |
Information nécessaire
Description du bogue
Lorsqu'un formulaire est enveloppé dans
Avec ce config la validation wet-boew est activée/initialisé. Cela peut briser des fonctionnalités (à re-confirmer, je travail là dessus) comme les conditionnels des formulaires Web fournis par le module Webform conçu pour Drupal 9 ou Drupal 10. Les conditionnels sert également de Javascript alors il y a un conflit entre
Wet-boew (tous les versions) https://wet-boew.github.io/v4.0-ci/demos/formvalid/formvalid-en.html
et
Webform (tous les versions). https://www.drupal.org/project/webform
Pour le reproduire
Étapes pour reproduire le problème :
'#prefix': '<div class="custom-wrapper wb-frmvld">'
'#suffix': '</div>'
Scénario attendu
Tout les conditions programmé à travers la configuration du formulaire devrait fonctionner avec ou sans l'élément div class="wb-frmvld"
Qui devrait travailler à corriger ce problem?
Je vais le faire, je veux contribuer
Information additionnelle (optionel)
Version de WET-BOEW/GCWeb que vous utilisez
v4.0.43.1 à v4.0.50+
Ordinateur/Téléphone intelligent
Captures d'écrans
Aucun
Contexte additionnel
LE TRAVAIL À FAIRE
Les instructions de construction et de compilation de wet-boew sont ici :
https://wet-boew.github.io/v4.0-ci/docs/start-en.html
Déboguer la fonctionnalité liée à wb-frmvld (validation de formulaire de wet-boew), faire particulièrement attention à tout javascript qui supprime des événements, s'assure que bind sert des espaces de noms spécifique pour wet-boew qui n'entrent pas en conflit avec d'autres, changer la logique pour supprimer les événements de wet-boew avec noms et régénérer les événements en utilisant les événements de wet-boew avec un espace de nom (namespace), autant possible ne pas supprimer les événements existants durant l'initialisation, examiner si les changements DOM cassent les conditionnels du formulaire web, déboguer et corriger le problème.
The text was updated successfully, but these errors were encountered: