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
Uneditable trim invisible from select #934
base: main
Are you sure you want to change the base?
Uneditable trim invisible from select #934
Conversation
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
=========================================
+ Coverage 95.17% 95.4% +0.23%
=========================================
Files 24 24
Lines 2776 2788 +12
Branches 251 251
=========================================
+ Hits 2642 2660 +18
+ Misses 90 86 -4
+ Partials 44 42 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we need docs for the new option, and a small test case (so we catch any regressions later)?
But good work picking this up! 👍
Hi @carltongibson. Thanks for your comments. Tests, yes. I'll take a look at that. As for docs, this got me thinking. The solution that was proposed added a new helper, and so yes we should have docs for that. But I've now got some questions!
@bryan-brancotte appreciate your thoughts to. |
Hi @smithdc1 Maybe our approach to keep a select is not the good idea, as mentioned in #817 (comment) with boostrap2 it was only a span, so not all the option, maybe we should go back to this behavior and use https://getbootstrap.com/docs/4.0/components/forms/#readonly ? Pros:
Cons:
In conclusion : either user readonly of BS4 or just disabled plus not-triming |
065567d
to
5b458d1
Compare
Hi @bryan-brancotte If so I suggest the latter, this is especially true if problem be solved by a method in a form class (similar to #935 ) ? In the meantime I've had another look at this and writing some tests and docs helped me to understand this issue in more detail. Below is my thought process. I've added three fields to the test project being
See here for generated HTML. The fields are just above the submit buttons. When setting the option to Having written the docs, I don't think it is too intrusive. By default the behaviour is unchanged (no trimming) and so it allows people to enable the disabled field through JS. The trimming function is done through an argument on the |
Hi @smithdc1 For the bs2 approach, if we want to let dev trim the queryset, I proposed https://getbootstrap.com/docs/4.0/components/forms/#readonly as it looks nice, but don't know the amount of work to make it work. Indeed the span is not printed so I guess it is, at least, not working out of the box. So maybe just forget my proposition and keep the trimmed select ;) ?
|
This work was done some time ago but a PR was never raised (that I can see). I've rebased the changes and made a tweak to maintain python 2 support. Fixes #817