Skip to content

CSP inline-style error when hovering over the donut chart tooltip #2907

@FlyMaple

Description

@FlyMaple

CSP inline-style error when hovering over the donut chart tooltip

Description

When hovering over the donut chart, the tooltip appears, but it triggers a CSP violation due to inline styles.

Steps to Reproduce

  1. Render a donut chart with tooltips enabled.
  2. Ensure CSP settings prohibit style-src 'self' 'nonce-123456' https:; styles.
  3. Hover over the chart to display the tooltip.
  4. Check the browser console for CSP errors.

Expected Behavior

The tooltip should be displayed without causing CSP violations.

Actual Behavior

The browser console reports a CSP violation related to style="background-color: ...".

Possible Cause

After reviewing the source code, I found that inline styles are applied to the tooltip using style="background-color: ...", which is blocked by CSP.

Suggested Fix

Consider using CSS classes or a safer approach to apply styles instead of inline styles.

Environment

  • Library/Framework: [Specify the version]
  • Browser: [Specify browser & version]
  • CSP Settings: style-src 'self'; (or other restrictions in place)

Would appreciate any suggestions or fixes regarding this issue. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions