trussworks / react-uswds

USWDS 3.0 components built in React
https://trussworks.github.io/react-uswds/
Apache License 2.0
177 stars 80 forks source link

[fix] smooth scrolling css leaks from component to whole package #2867

Closed werdnanoslen closed 4 months ago

werdnanoslen commented 4 months ago

ReactUSWDS Version & USWDS Version:

At least react-uswds v9.0.0

Describe the bug

This smooth scrolling leaks to any page where this package is used

https://github.com/trussworks/react-uswds/blob/db2e4f6e550ec316ec5637aeded3d720fec88d7b/src/components/InPageNavigation/InPageNavigation.module.scss#L1-L5

To Reproduce Steps to reproduce the behavior:

  1. Use react-uswds on a page, use any component but InPageNavigation
  2. See that the smooth scrolling is applied to the html root

Expected behavior

It should only be applied where the InPageNavigation component is used.

Additional context

Device and Browser Information (please complete the following information if describing a UI bug):

All browsers