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 /r/learnjavascript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • 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.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
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