uxebu / bonsai

BonsaiJS is a graphics library and renderer
http://bonsaijs.org
Other
1.96k stars 189 forks source link

Only `preventDefault()` events if really needed #160

Open davidaurelio opened 11 years ago

davidaurelio commented 11 years ago

At the moment we call preventDefault() on every event. That leads to problems with scrolling and touch gestures.

We should mark elements that listen to drag and move events for the renderer, and the renderer should call preventDefault() only for events that affect these elements.

prashantsani commented 8 years ago

👍 For this issue. Currently Solving this issue by CSS "pointer-events" property

#player {
  pointer-events:none;
}
#player g,
#player path{
    pointer-events:auto; /* if you want :hover events on some paths/g */
}

But this only partially solves the problem. The reason being when scrolled on SVG elements that rely on :hover events, it preventDefaults. A user should be able to use the default scroll as well as :hover events.