-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use of hidden="hidden" breaks DjDT when used with bootstrap4 and pureCSS #742
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
Comments
Fixed it for me with this rule:
|
@ssbb thanks for the workaround. We're using it for now in cookiecutter-django. |
@ssbb, thanks, had this problem when starting with bootstrap4. |
Admitted, I don't understand the security policy issue, which is the reason for using the hidden attribute in this way. However, regardless I believe somethings wrong here. The hidden attribute's purpose is to define elements as hidden. I think PureCSS and Twitter Bootstrap got it right. Maybe django_toolbar should revert to using the data attributes if possible. This issue will likely affect more and more people in time. Still, wonderful Django addon 👍 👍 @ssbb: Perfect workaround! 👍 |
Better to use "contains" instead of equality (because toolbar handle is movable (via style="top: xxx") and if you will move it, you can never see it again :D)
|
Perhaps we could achieve the desired effect with a |
BTW, found the same issue, when using Material Design Lite's css. |
Indeed, I noticed that a few days ago as well. |
Same issue with MDL @aaugustin, did you find out a trick ? |
4111d93 should fix this. |
Remove this hack after upgrading of debug toolbar on version > 1.4, see django-commons/django-debug-toolbar#742.
Remove this hack after upgrading of debug toolbar on version > 1.4, see django-commons/django-debug-toolbar#742.
please release a new fix version on pypi. @aaugustin |
Yes please |
django-debug-toolbar
useshidden="hidden"
attributes on its HTML elements which are left regardless of element being displayed or not. This causesdjango-debug-toolbar
UI (both handle and main interface) to remain hidden when used together with Bootstrap 4 or PureCSS.Both Boostrap 4 and PureCSS use:
https://github.com/twbs/bootstrap/blob/v4.0.0-alpha/scss/_utilities.scss#L35
The problem is that jQuery
.show()
does not removehidden="hidden"
attribute but instead setsstyle="display: block"
, which is overriden by the above CSS block (See note about!important
in http://api.jquery.com/show/)One approach would be to follow jQuery docs and use
.css('style', 'display: block !important')
. A better approach would be to usestyle="display: none"
instead ofhidden="hidden"
which I think is better, sincestyle
attribute is also used for setting DjDT handle position.The text was updated successfully, but these errors were encountered: