Question re: sliding canvas on touch | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Question re: sliding canvas on touch

In this code, if run as is, when you touch/drag the screen/canvas slides which is problematic. If the <canvas> container is uncommented it still slides. If <canvas> is left commented and the <style> container is uncommented it resolves the issue. As both containers use the same style values, why does one work but not the other? https://sololearn.com/compiler-playground/WWET43frXN76/?ref=app

28th Jan 2024, 2:01 AM
Scott D
Scott D - avatar
7 Answers
+ 2
Solo No, there's no confusion here🤣 If you uncomment the <Canvas> section, run the code then touch and move your finger up & down the screen, the canvas slides and slightly stretches, and there is not a steady stream of ellipses. However, if instead only the <style> container is uncommented (or both) then the canvas does not slide and the ellipses render steadily without issue.
28th Jan 2024, 2:45 AM
Scott D
Scott D - avatar
+ 2
Solo This video clearly illustrates the problem. It's quite obvious, at least to me, that there is an issue with which method is used to style the canvas. In one case the canvas is -not- fixed, regardless of what the "position:fixed" indicates... https://sololearn.com/compiler-playground/Wp6TPT0HA3qI/?ref=app
28th Jan 2024, 3:20 AM
Scott D
Scott D - avatar
+ 2
Solo As the video clearly shows, this is occuring in the Sololearn app.
28th Jan 2024, 4:19 AM
Scott D
Scott D - avatar
0
Both options work equally well for me. Maybe you're already confused yourself...😎
28th Jan 2024, 2:16 AM
Solo
Solo - avatar
0
Scott D That's what I did. In both cases, the canvas is fixed.
28th Jan 2024, 2:57 AM
Solo
Solo - avatar
0
Scott D Yes, I understood perfectly well what it was about.
28th Jan 2024, 4:09 AM
Solo
Solo - avatar
0
Scott D perhaps your browser does not perceive this style in the html tag.
28th Jan 2024, 4:13 AM
Solo
Solo - avatar