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
Hide side_panel_button if empty #8492
Merged
thibaudcolas
merged 2 commits into
wagtail:main
from
stevedya:chore/8465-side-panel-invisible-button
May 6, 2022
Merged
Hide side_panel_button if empty #8492
thibaudcolas
merged 2 commits into
wagtail:main
from
stevedya:chore/8465-side-panel-invisible-button
May 6, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Manage this branch in SquashTest this branch here: https://stevedyachore8465-side-panel-i-mwkbc.squash.io |
lb-
reviewed
May 5, 2022
{% endif %} | ||
</button> | ||
{% spaceless %} | ||
<button type="button" class="{{ classes }} w-bg-transparent w-text-14 w-p-0 w-text-teal-200 hover:w-text-teal-600 w-inline-flex w-justify-center w-transition empty:w-hidden" {% if data_url %}data-url="{{ data_url }}" {% endif %}{% if has_toggle %}data-button-with-dropdown-toggle {% endif %}{{ attr }}>{{ text }} |
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.
can the {{ text }}
be on a new line - makes it easier to read what is being done here, especially with the super long classes.
Suggested change
<button type="button" class="{{ classes }} w-bg-transparent w-text-14 w-p-0 w-text-teal-200 hover:w-text-teal-600 w-inline-flex w-justify-center w-transition empty:w-hidden" {% if data_url %}data-url="{{ data_url }}" {% endif %}{% if has_toggle %}data-button-with-dropdown-toggle {% endif %}{{ attr }}>{{ text }} | |
<button type="button" class="{{ classes }} w-bg-transparent w-text-14 w-p-0 w-text-teal-200 hover:w-text-teal-600 w-inline-flex w-justify-center w-transition empty:w-hidden" {% if data_url %}data-url="{{ data_url }}" {% endif %}{% if has_toggle %}data-button-with-dropdown-toggle {% endif %}{{ attr }}> | |
{{ text }} |
thibaudcolas
force-pushed
the
chore/8465-side-panel-invisible-button
branch
from
May 6, 2022 14:47
e846d30
to
28a168e
Compare
thibaudcolas
approved these changes
May 6, 2022
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.
Woo!
thibaudcolas
added a commit
that referenced
this pull request
May 6, 2022
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
stevedya
added a commit
to stevedya/wagtail
that referenced
this pull request
May 18, 2022
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #8465. Using the empty: selector with css we are able to hide the button if there is nothing inside of it so that the empty element cannot be tabbed to.
empty:
variant still works as expectedempty:w-hidden
to hide the side panel button from screen readers when it is empty.Wagtail.-.Editing.Blog.page_.Long.Blog.posting.-.5.May.2022.mp4
Tested on
Chrome 100, Safari 15.2, Firefox 99 (with browser-sync)