d3plus/d3plus-viz

[mobile] [chrome] Error in console on any click event on the page

Closed this issue · 1 comments

Screen Shot 2021-10-20 at 13 59 51
Screen Shot 2021-10-20 at 13 57 33

Expected Behavior

No error on click

Current Behavior

Any click on a site with a chart launch an error in console. (one error per loaded chart presents in the ssame page)
ONLY IN SMALL SCREENS and APPARENTLY ONLY IN CHROME (safari and firefox seems to be ok).

Uncaught TypeError: Cannot read properties of undefined (reading 'preventDefault')
    at e.Fn (client-d3plus.js?v1632253905171:1)
    at HTMLBodyElement.<anonymous> (client-d3plus.js?v1632253905171:1)

Steps to Reproduce (for bugs)

  1. Go to any of our sites. You can use the d3plus example pages because configs there are pretty basic: https://d3plus.org/?path=/docs/charts-bar-chart--bar-chart
  2. Open developers tools.
  3. Toggle device and simulate a small screen.
  4. Click in any part of the page, You will see the error in the console.

Your Environment

  • Browser Name: chrome
  • Operating System and Version: macos Catalina

@ffigueroal steps to test:

  1. add a user on: {click: () => /* changes underlying viz data to remove currently clicked shape */}
  2. add a user on: {click: () => /* completely removes <div> element containing current viz */}

If completely removing the touchstartBody function in it's entirely has no effect on the tooltip remaining for these 2 states, we should just remove it entirely!