-
Notifications
You must be signed in to change notification settings - Fork 207
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
Tag field is pre-populated with an unrelated value #622
Comments
Hey, I haven't yet checked your code (BTW you have a nice formatted example code, that's great), but I think |
@aminalaee Thank you very much for looking into the issue. Open source is a tough job, and I'm all in to make it a bit easier. As the documentation suggests, the For now, I can work around the bug by deliberately using |
You're right. But first I need to say that console error is not relevant. I need to check that separately. About this issue, it is normal that the browser selects the first option, so you need to add an empty option: https://stackoverflow.com/questions/40905579/flask-wtf-dynamic-select-field-with-an-empty-option But if you try that the UI gets a bit weird, because this is not normal select, it is select2 option, so in addition to that empty option, we also need to add a placeholder which makes it nice: https://groups.google.com/g/select2/c/QCP1srwg48s?pli=1 PRs welcome, otherwise I can check it later. |
Thanks for investigating it more deeply, your findings led me to PR, please take a look 🙏 |
Checklist
master
.Describe the bug
The select tag field gets prepopulated with the unrelated value. The issue happens both on creation and edit actions. The list of available options is updated with
form_args
ModelView
field.Steps to reproduce the bug
Expected behavior
A form with an empty input is shown up.
Actual behavior
Input is populated with "firmware_schedule:edit" value. The browser debug console has an error trace:
Debugging material
Please replace postgres engine link while reproducing the error with the provided code sample.
App sample
Environment
Browser: Version 116.0.5845.187
OS: Mac OS Ventura 13.5.2
Postgres: 12.14
Python: 3.11
Requirements.txt:
Additional context
No response
The text was updated successfully, but these errors were encountered: