-
I'm trying to build a similar demo to one of the examples https://codesandbox.io/embed/r3f-moksha-f1ixt My problem is as I start using a scroll area, all the pointer events are grabbed by the scroll area and the canvas doesn't receives them anymore, I tried using Demo with my setup https://codesandbox.io/s/react-three-fiber-pointer-events-z429y |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
this will all get easier in v6 which is using addeventlistener instead of react events. you could theoretically already try it. in this example for instance it's adding events to document.body https://codesandbox.io/s/gltf-simple-example-v6-forked-o8mnv?file=/src/index.js |
Beta Was this translation helpful? Give feedback.
-
This seems to offset all the events position to the scroll area coords, would that not be the case using the connect feature in V6 ? I'm just a little confused on how to use the import {Canvas} from 'react-three-fiber@v6"
function R3FApp() {
retrun(
<Canvas onCreated={(state) => state.events.connect(document.body)} />
)
}
function App() {
return(
<div>
<R3FApp />
<OtherReactComponents />
</div>
)
}
ReactDOM.render(<App />, document.getElementById('root')) |
Beta Was this translation helpful? Give feedback.
this will all get easier in v6 which is using addeventlistener instead of react events. you could theoretically already try it.
in this example for instance it's adding events to document.body https://codesandbox.io/s/gltf-simple-example-v6-forked-o8mnv?file=/src/index.js