TCCP: Fix mobile horizontal scroll in card list #8732
Merged
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.
There's a slight but annoying horizontal scroll on the TCCP card list page in mobile Safari (see GHE/Design-Development/External-Products/issues/491). Looks like it was being caused by the combination of breadcrumbs on a full-width page, which I don't think we do anywhere else on the site (at least not in quite the same way). It's most easily fixed with an
overflow-x: hidden
on theu-layout-grid
container, just like we do in the 2-1 layout to prevent the sidebar from bleeding. Doing some grid magic like we do with the 1-3 layout also could have worked, but that seemed more complicated.I went with a utility class to get the
overflow-x
, but if there's a cleaner way to do it, happy to change approaches.Additions
u-layout-grid--full-width-breadcrumbs
utility classHow to test this PR
Because this only inconsistently shows up in some desktop emulators and because we can't inspect iOS Safari from our CFPB iPhones and Macs, it's a pain to debug and test. So, two options.
If you happen to have a personal Mac and iPhone, you can follow the instructions linked above to inspect mobile Safari from desktop Safari. Add an
overflow-x: hidden;
declaration to theu-layout-grid
container while inspecting the production page to simulate this fix. Note that, before adding that, there's a slight horizontal scroll. After, there shouldn't be.If you don't have a personal iPhone and Mac, you can go into Responsive Design Mode on desktop Safari on our CFPB Macs. Without this fix, you should be able to scroll right just a bit (but you can't scroll back, weirdly). With this fix, there should be no scroll.
Either way, nothing should change in any other browser, mobile or desktop.
Checklist