Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8677915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:35:08+00:00 2026-06-12T20:35:08+00:00

I am building an interactive visualization app that is pretty much all client-side Javascript,

  • 0

I am building an interactive visualization app that is pretty much all client-side Javascript, see here:

http://korhal.andrewmao.net:9294/#/classify/APH10154043

Try the following controls:

  • mousewheel: zoom
  • drag empty area: pan
  • drag bottom area or handles: pan/zoom
  • click once, then click again: draw a box
  • drag on box: move box
  • drag edges of box: resize

The underlying mechanism is a SVG overlying a canvas. The canvas has z-index 0 and the SVG z-index 1 – feel free to inspect the DOM. Everything works pretty much fine on Chrome/Firefox.

The problem is, in IE9, the canvas seems to receive click events over the SVG, even with a lower z-index. You can tell because the mousewheel/click/drag actions don’t work in the main chart area, yet they work in the edge areas because the SVG is slightly larger than the canvas and it picks up the events there. For example, try mousewheeling in the axis areas or the bottom.

After playing with it some more, I think I saw the pathology. I made a version of the page where I allowed boxes to be drawn outside the canvas (graph) area but still inside the SVG. Then I could do the following (in IE):

  1. Draw a box in the axis area (outside of canvas)
  2. Drag it into the main area (over the canvas)
  3. Hold mouse over the box and use mousewheel – now the zoom events are picked up by the SVG. Mousewheeling where there was no box caused the events to go to the canvas (disappear.)

So it seems what is happening is that the SVG is only picking up mouse events when there is an explicit SVG object under the mouse, otherwise it gets passed through to the canvas, and only in Internet Explorer.

One obvious way to solve this problem is to make a transparent rect over the entire SVG region, but that seems stupid. Also, maybe I’m doing something wrong that is patched up when using Chrome but broken in IE. Does anyone have any suggestions?

Note: One (deleted) answer suggested wrapping the entire SVG region in a <g> element and applying pointer-events: all to it. However, that didn’t work. I don’t even think that is necessary, as pointer events are being detected fine in the entire SVG region except where there is a canvas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:35:09+00:00Added an answer on June 12, 2026 at 8:35 pm

    If you want to prevent clicks on transparent regions in the SVG from going through to the underlying Canvas, then I would use a (slightly modified) “stupid” solution: put a transparent rect underneath the SVG contents. Something like:

    <svg>
      <rect width="100%" height="100%" pointer-events="all" fill="none"/>
      <!-- … everything else … -->
    </svg>
    

    With fill=none and pointer-events=all, the rect won’t be visible, but it will still receive mouse events and prevent those from going through to the underlying Canvas. So, if you put a click listener on the SVG, the SVG would still receive the clicks rather than the Canvas. (You can apply this technique to a G element as well, though you’ll probably want to position the rect explicitly rather than using 100% width and height.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a C# client app that allows a user to communicate with one
I'm building an interactive javascript application that needs to make some SOAP requests to
I'm currently building a rather ambitious interactive wall for a client that must be
I'm building a site for a client that is comprised all of static content,
I am building an application that will function as a client-server application, and also
I am building an app for Android 2.1 that provides notifications based on calendar
After building a service that launches an interactive processes in a user's session via
I'm building an interactive movie of some sort , having more video clips that
I am building an Android app that works by providing information via SMS to
I'm building an interactive anagram feature at the moment for my iPad app and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.