-
Hi all, new to the react-three-fiber library. I was wondering how can I change the CSS attributes of the outer div that created before ?
Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
you are not supposed to change size, although you can of course give it styles and classes |
Beta Was this translation helpful? Give feedback.
-
Nah bro, I did not... I instead wrapped the canvas div into another div and
then proceeded with overlaying two divs on each side so that the user can
scroll using those divs and the middle div can be used for interaction of
canvas...
https://nihal-shah.vercel.app/
You can inspect this and understand what I mean to say...
Anyways if you do get the solution to it please let me know as it'd be
immensely helpful further in some projects.
Thank You,
Nihal
…On Thu, Feb 16, 2023 at 6:16 PM usaurabh02 ***@***.***> wrote:
Hi, did you got the solution, how to change touch-action. I'm runninginto
the same issue.
—
Reply to this email directly, view it on GitHub
<#1222 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATSVWBDXSUHD46LEQER3EDTWXYORJANCNFSM42YVOO3A>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
OOOOOWWWW yeaahhhhh damnnnn. Thanks, a lot buddy! Will surely implement it
in the future!
…On Thu, Feb 16, 2023 at 8:27 PM — ***@***.***> wrote:
touch action isn't set by fiber, you can just set it, it's a simple css
rule
canvas {
touch-action: ...
}
—
Reply to this email directly, view it on GitHub
<#1222 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATSVWBADPRS3YABF6VY42ILWXY56LANCNFSM42YVOO3A>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
you are not supposed to change size, although you can of course give it styles and classes
<Canvas style={{ ... }} class="..." />
but better size the div that wraps it. canvas will automatically take up the space of its relative/absolute parent with a resize observer.