Skip to content

Exception thrown when canvas is inside a tag #5826

@karaxuna

Description

@karaxuna

Expected Behavior

When target element for Chart is inside anchor tag, chart should render normally.

Current Behavior

Currently this method fails, because parent anchor tag has property host which is localhost:3000 in my case, so this method returns localhost:3000 instead of parent element.

helpers._getParentNode = function(domNode) { var parent = domNode.parentNode; if (parent && parent.host) { parent = parent.host; } return parent; };

Context

Environment

  • Chart.js version: 2.7.3
  • Browser name and version: Chrome Version 70.0.3538.77 (Official Build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions