Page 1 of 1

webview component moving when scrolling the mouse preventing the page from scrolling.

Posted: Thu Sep 29, 2022 6:26 am
by skinkairewalker
Hi guys, I'm trying to use webview on macOS, but I'm having problems scrolling the page, depending on how fast I drag up or down, the webview component also seems to move, if I drag slowly, the page scroll moves ... is there a way to prevent the webview from moving , just the scroll of the loaded page ?

video below :
https://imgur.com/a/r4qFcot

Re: webview component moving when scrolling the mouse preventing the page from scrolling.

Posted: Tue Oct 04, 2022 5:04 am
by fsw
What you see is not the WebGadget moving, but the webpage is "bouncing".
I know it's totally unnecessary but this is the way macOS (and iOS, iPadOS, etc.) shows fancy UI stuff.

Try this code with a colored window background and you will see that the gadget doesn't move:

Code: Select all

 If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    WebGadget(0, 10, 10, 580, 280, "https://www.purebasic.com")
    ; Note: if you want to use a local file, change last parameter to "file://" + path + filename
    SetWindowColor(0, RGB(200, 100, 200))
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
  

Re: webview component moving when scrolling the mouse preventing the page from scrolling.

Posted: Wed May 10, 2023 11:40 pm
by skinkairewalker
how can i disable this ?

Re: webview component moving when scrolling the mouse preventing the page from scrolling.

Posted: Wed Jun 07, 2023 5:51 pm
by jamirokwai
Have a look at CSS: https://caniuse.com/mdn-css_properties_ ... l-behavior. You should add a snippet like that to your .html.

That could do the trick. The bouncing is enabled by default on MacOS, so you can be sure, every user has it enabled...