himynameisdave / svelte-frappe-charts

📈 Svelte bindings for frappe-charts.
https://frappe.io/charts
MIT License
310 stars 16 forks source link

IsNavigable Uncaught Type errors #47

Open stratasy opened 3 years ago

stratasy commented 3 years ago

When copying and pasting the code for the navigable bar chart:

<script>
  import Chart from "svelte-frappe-charts";

  let data = {
    labels: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Mon" ],
    datasets: [
      { values: [ 300, 250, 720, 560, 370, 610, 690, 410, 370, 480, 620, 260, 170, 510, 630, 710 ] },
    ],
  };

  const onDataSelect = (event) => {
    console.log("Data select event fired!", event);
    selected = event;
  };
  let selected;
</script>

<Chart {data} on:data-select={onDataSelect} isNavigable type="bar" />

I am getting these errors: Uncaught TypeError: Cannot read property 'nodeName' of undefined and Uncaught TypeError: Cannot read property 'parentNode' of undefined

image

stratasy commented 3 years ago

Just an update: Rolling back to 1.8 fixes this issue, so it might have something to do with the PR @bry-an put out. Obviously rolling this back reintroduces the issue described here: https://github.com/himynameisdave/svelte-frappe-charts/issues/44

marciox25 commented 2 years ago

Any followup on this? Im also able to replicate by simply copying the code mentioned in the issue in an component. Rolling back to 1.8 did not fixed it for me

kuutsav commented 2 years ago

Hi, any update? I'm facing the same issue

Gildedter commented 1 year ago

Facing a similar issue image image

removing the isNavigable property removes the error (with just the event assigned), but without that property, no event would fire, I just pasted the Chart Navigation example on the ReadMe