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

Form: prevalidation form tuning #11270

Open
3 tasks
agjohnson opened this issue Apr 10, 2024 · 0 comments
Open
3 tasks

Form: prevalidation form tuning #11270

agjohnson opened this issue Apr 10, 2024 · 0 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@agjohnson
Copy link
Contributor

A few notes to come back to for tuning on this pattern:

  • Turn the prevalidate form into a mixin, so that the base form can be forms.Form or forms.ModelForm without struggling with any conflicts. Maybe this isn't necessary.
  • is_disabled should reference self.errors I think. This would populate the prevalidation errors if form.errors wasn't called first. The use case here is when displaying the form, we might use <form {% if form.is_disabled %}inert{% endif %}> before we actually call {{ form | crispy }}. The crispy filter calls form.errors which populates all the validation errors.
  • Project: create forms are still usable by keyboard when disabled ext-theme#279 -- a few options here are <form inert>, disabling all of the fields in the Form class, or wrapping with .ui.disabled.segment instead. There is no .ui.disabled.form unfortunately.
@agjohnson agjohnson added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
Status: Planned
Development

No branches or pull requests

1 participant