department-of-veterans-affairs / vets-design-system-documentation

Repository for design.va.gov website
https://design.va.gov
36 stars 55 forks source link

[Bug] Alert Box width setting #337

Closed Mottie closed 1 month ago

Mottie commented 3 years ago

Bug Report

What happened

During a QA review, an indented alert box was found to extend off screen in both IE11 and mobile devices (ticket).

While troubleshooting, I found that the culprit is the usa-alert definition (source code):

.usa-alert {
  background: none;
  background-color: #f1f1f1;
  border-left-style: solid;
  border-left-width: 10px;
  display: table;
  padding: 3.2rem 6.4rem 3.2rem 2.4rem;
  width: 100%;
}

The width: 100% setting is causing the alert to overflow beyond its wrapper boundary.

Screenshots from QA ticket ![](https://user-images.githubusercontent.com/587583/98744215-8f26ee00-236e-11eb-9183-21d2b70b0039.png) ![](https://user-images.githubusercontent.com/587583/98748807-acac8580-2377-11eb-84dc-6b563645784e.png)

What I expected to happen

Alert box width should not extend beyond viewport

Expected alert box size ![](https://user-images.githubusercontent.com/587583/98744437-f04ec180-236e-11eb-879a-cb795dd20e96.png)

Reproducing

Steps to reproduce:

  1. Go to https://staging.va.gov/decision-reviews/higher-level-review/request-higher-level-review-form-20-0996/introduction
  2. IF Is this the form I need? section (eligibility wizard) is displayed, click Disability..., No, then Request.... Browser replaces widget content with sign-in alert and regular intro content.
  3. In sign-in alert, click Sign in..., and sign-in as vetsgov+test236@id.me (Charde). [See this doc for credentials.]
  4. IF application-in-progress alert is displayed, click Continue....
  5. Click Back or Continue to go to Step 2 of 4: Contested issues page.
  6. Select (check) If possible... same office checkbox -- checkbox should be filled-in -- and observe that We will try... alert-box extends to right-hand-side page-edge.

Possible Fix

humancompanion-usds commented 1 year ago

This will get fixed when we adopt the USWDS Alert component, which is imminent. It does not set a width. It also solves for the excessive padding at mobile viewport widths. It does not use flexbox but, it doesn't use table for display either.

Mottie commented 1 month ago

@caw310 I think we can close this ticket now