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

TypeAhead Widget not working with some Validators, like HiddenUnless #5048

Closed
jbtwist opened this issue Aug 23, 2021 · 6 comments · Fixed by #5050
Closed

TypeAhead Widget not working with some Validators, like HiddenUnless #5048

jbtwist opened this issue Aug 23, 2021 · 6 comments · Fixed by #5050
Labels

Comments

@jbtwist
Copy link
Contributor

jbtwist commented Aug 23, 2021

Describe the bug
When you combine TypeAhead Widget with attributes for validators added at render_field function, it won't work because those validators won't be added

To Reproduce
Steps to reproduce the behavior:

  1. Go to any registration form (in my case, I went to RegistrationFormForm)
  2. Add a first (A) StringField with HiddenUnless validator and TypeaheadWidget
  3. Add a second (B) StringField only with HiddenUnless validator
  4. Activate the field that triggers the HiddenUnless, it will only work on B.

Expected behavior
I expect the HiddenUnless validator (and other extra validators) to work in combination with Typeahead widget.

Screenshots
image
image.

Additional context
I'm not sure if this issue is afecting to more widgets. For example I think it is afecting to the ckeditor_widget, but I have not tested it.

@jbtwist jbtwist added the bug label Aug 23, 2021
@ThiefMaster
Copy link
Member

I don't think we are using this combination anywhere in Indico, are we? The client-side validators that add magic like HiddenUnless are somewhat fragile when it comes to non-standard fields (anything that's not a standard form field but makes heavy use of JS), so unless this is breaking anything in the core I think it's unlikely that we are going to fix this (but a PR is welcome as long as it's not likely to break anything)

@jbtwist
Copy link
Contributor Author

jbtwist commented Aug 23, 2021

Yes, I am preparing the PR that fix this, I don't think It will break anything because it is mostly copied from the Date-Widget logic, and it would fix an Issue at the UN side.

@ThiefMaster
Copy link
Member

OK, thanks! Please open the PR against the 3.0.x branch.

@jbtwist
Copy link
Contributor Author

jbtwist commented Aug 23, 2021

I cannot push a new branch to the proyect, can you tell me why can't I and how to add my PR then please?

image

@ThiefMaster
Copy link
Member

We're using the standard workflow pretty much all projects on github uses, so you need to fork the repo and push the branch to your fork...

@jbtwist
Copy link
Contributor Author

jbtwist commented Aug 23, 2021

oh, ok, tyvm

@ThiefMaster ThiefMaster linked a pull request Aug 23, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants