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

Mac OSX specific forum
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 627
Joined: Fri Dec 04, 2015 9:26 pm

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

Post 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
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

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

Post 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
  

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 627
Joined: Fri Dec 04, 2015 9:26 pm

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

Post by skinkairewalker »

how can i disable this ?
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

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

Post 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...
Regards,
JamiroKwai
Post Reply