Description
The tab component uses an <a>
element to wrap the tab contents but prevents default navigation behavior through the use of href="javascript:void(0);"
. This doesn't play nicely with CSP policies without the unsafe-inline
directive which prevent the script from executing but also add a warning in the console.
The SLDS blueprints for the tab component seem to suggest the Javascript URL approach as well so I'm not sure whether this issue really belongs there.
A potential solution would be to prevent the default behavior of click/keydown events where they're handled within the parent tabs component.
design-system-react/components/tabs/index.jsx
Lines 252 to 298 in ecb0854
Happy to contribute if there's an agreeable fix.
It looks like there are some more examples of this. #2463 seems likely related.