Thanks to visit codestin.com
Credit goes to github.com

Skip to content

USWDS - Bug: Modal removes existing padding on close #5361

@mejiaj

Description

@mejiaj

In storybook we have a right padding set on body. When modal checks for body.style.paddingRight we get an empty string. This causes a visual regression where the incorrect padding is set and then removed all together.

Related code

body.style.paddingRight =
body.style.paddingRight === TEMPORARY_PADDING
? INITIAL_PADDING
: TEMPORARY_PADDING;

Examples

Initial padding

image
Padding gone on modal close

image

Steps to reproduce

  1. Go to default modal example in develop.
  2. Resize browser to 400px.
  3. Confirm 16px padding on right side.
  4. Open and close modal.
  5. Confirm right padding is now gone.

Additional context

Originally found when testing PR #5315.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions