Can't prevent the click event of a component from a JS library?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/learnjavascript

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • apexcharts.js

    📊 Interactive JavaScript Charts built on SVG

    I'm working on a Vue app and I'm using ApexCharts, and I'm running into an issue with how this library normally handles clicks: if you click on a bar in a bar chart, it will visibly toggle it, so the color changes. This is a problem because when it visibly toggles, it messes up what I'm trying to show on the page. There are multiple potential solutions to this, none of which I seem to be able to do with this library. But the simplest is to just disable clicks on the chart, so clicking anywhere will do absolutely nothing. But even this I can't figure out how to accomplish. I tried a @click.stop handler, I tried a @click handler that passes an event where I call event.preventDefault(), event.stopPropagation(), and event.stopImmediatePropagation(). None of these work.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts