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

#8975 Fix tag display when they run off the page #9336

Merged
merged 8 commits into from
Jan 31, 2023

Conversation

sekmiller
Copy link
Contributor

@sekmiller sekmiller commented Jan 26, 2023

What this PR does / why we need it: The display of file tags (actually categories) runs off the side of the page on the file page when there are numerous long categories associated with a file. This PR updates the css to fix the word break. For reasons that are not entirely clear this also fixes the wrapping of the file description wrapping issue 9325

Which issue(s) this PR closes:

Closes #8975 File level metadata: File level metadata tags should wrap and not run off the page.
Closes #9325 Description metadata field: description field text should wrap and not run off the page

Special notes for your reviewer:

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No
Is there a release notes update needed for this change?:
no
Additional documentation:

@sekmiller sekmiller added this to Ready for Review ⏩ in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) via automation Jan 26, 2023
@sekmiller sekmiller added this to the 5.13 milestone Jan 26, 2023
@qqmyers
Copy link
Member

qqmyers commented Jan 26, 2023

On demo, if I add word-break: break-word to the file-tags div, these wrap:
from
image
to
image
Does just

#file-tags {
word-break:break-word;
}

in the structure.css file work?

@coveralls
Copy link

coveralls commented Jan 26, 2023

Coverage Status

Coverage: 19.937%. Remained the same when pulling 997acde on 8975-fix-wrapping-of-file-tags into eb5fec8 on develop.

@landreev landreev moved this from Ready for Review ⏩ to Review 🔎 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Jan 27, 2023
@landreev landreev self-requested a review January 27, 2023 19:37
@landreev landreev self-assigned this Jan 27, 2023
@sekmiller
Copy link
Contributor Author

I wasn't able to get the css to recognize the style (is there a particular place I have to put it?) but even when I did this:

                                                        <div id="file-tags" style="word-break:break-word; background-color: yellowgreen;"> 

directly in file.xhtml I got this:
Screen Shot 2023-01-27 at 3 43 44 PM

Copy link
Contributor

@landreev landreev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reasons that are not entirely clear this also fixes the wrapping of the file description wrapping issue 9325

I'm assuming the reason is that the page renders these separate divs based on the maximum character width, i.e. the longest one; which must have been this combined tags label - and now that it's solved, all the other ones are rendered normally? - just a guess.

IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from Review 🔎 to Ready for QA ⏩ Jan 30, 2023
@landreev landreev removed their assignment Jan 30, 2023
@qqmyers
Copy link
Member

qqmyers commented Jan 30, 2023

It looks like Safari is the one major browser that doesn't handle word-breaks quite the same way. The following css added to structure.css and the addition of a (non-visible) space between the tags themselves appear to work (awaiting testing from @sekmiller ). It looks like this retains the responsive design and flows as the page width is decreased.

#file-tags .label {
    white-space:normal;
}
//Safari-only
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) and (display:flow-root) {
        #file-tags .label {
            white-space: break-spaces;
        }
    }
}

<h:outputText value="#{tag}" styleClass="label label-default"/>

-> value="#{tag} "

@sekmiller sekmiller changed the title #8975 add breaks in tags after 80 accumulated characters #8975 Fix tag display when they run off the page Jan 30, 2023
@sekmiller
Copy link
Contributor Author

the fix suggested by Jim works in Safari and Firefox. I did notice that the tags run off the page in Safari if you make the page too narrow, but we've seen that in other places on Safari and we may have to just live with it.

@sekmiller sekmiller removed their assignment Jan 30, 2023
@kcondon kcondon self-assigned this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5 participants