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

Should the python_code field be optional in FilingStatusForm? (An invalid form control with name='python_code' is not focusable.) error is coming on clicking save. #521

Open
unreal0901 opened this issue Feb 24, 2025 · 1 comment

Comments

@unreal0901
Copy link
Contributor

I encountered an issue where the python_code field is marked as required, which prevents form submission when the field is empty. This causes an invalid form control error in the console:

"An invalid form control with name='python_code' is not focusable."

Additionally, the modal dialog that contains the form is using aria-hidden="true", which is blocking focus on the form elements.

Would it be better to make python_code optional? Adding the following line in the __init__ method of FilingStatusForm seems to resolve the issue:

self.fields["python_code"].required = False

Should this be the correct approach, or is there a reason why python_code should remain required?

This type of error is coming when clicking on save button..

Image

@horilla-opensource
Copy link
Owner

Hi @unreal0901 ,

Thank you for reporting this issue and for submitting a pull request with the fix! Making python_code optional by setting self.fields["python_code"].required = False in the init method seems like a reasonable solution, especially if an empty field is preventing form submission.

Additionally, the aria-hidden="true" issue in the modal might be causing accessibility and focus-related problems. We’ll review your PR and test the changes to ensure everything works smoothly.

We appreciate your contribution to Horilla! 🚀

Best Regards,
Team Horilla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants