Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: fix 404 when clicking on "Date Range Field" DemoContainer (#894)
On the home page, when a user clicks on a demo container with a title containing more than two words, they will get a 404. For example, "Date Range Picker" generates the link: `/components/date-range%20picker.html` rather than the correct link `/components/date-range%20picker.html`. The component responsible for generating this url is `<DemoContainer>`. It uses the `title` prop to generate the link. When a title has a space, it currently substitutes a hyphen for the space using `title.replace(" ", "-")`. However, `.replace()` only replaces the first instance when passed a string as the pattern, so only the first `" "` is replaced with a `"-"`. This updates to use a regex in `title.replace()` so that each instance of whitespace is replaced with a hyphen.
- Loading branch information