Browser sync scroll not working across browsers

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Browser sync scroll not working across browsers



I have been trying to solve this issue with broswersync for couple of days. Any help in this will be highly appreciated.



My Env:



I am on windows and my server in Ubuntu in a vagrant box. I have port forwarding on, and use port 3000 to map to port 3000 on my vagrant.
So the URL I use from the host machine is http://localhost:3000/index.html, and if from outside, then http://MY_IP_ADDRESS:3000/index.html



Description:



I have CSS injection, reload, form sync, clicks, working across all browsers and devices.
What does not work is the sync scroll and below are the scenarios.



My Gulp:



I work from windows, but my server is on vagrant/ubuntu.
Here is my Gulp config for browser sync and watch.


// Static server
gulp.task('browser-sync', function ()
browserSync(
server:
baseDir: "www"
,
ghostMode:
scroll: true

);
);
// Static Server + watching scss/html files
gulp.task('serve', ['scss'], function ()

browserSync(
server: "./www"
);
gulp.watch(paths.scss, ['scss',browserSync.reload]);
gulp.watch(paths.html, ['html',browserSync.reload]);
gulp.watch(paths.js, ['js',browserSync.reload]);
//gulp.watch("*.html").on('change', reload);
);



Thanks for your help in advance..





whats your BrowserSync version?
– Felipe Skinner
Apr 22 '15 at 2:35





thanks for the response. It is 2.6.4
– Tedscape
Apr 22 '15 at 3:09





hmm strange, I tried here a simple webapp (just html and js) with browsersync 2.6.4 and could not sync the scroll too... just the clicks :(
– Felipe Skinner
Apr 22 '15 at 3:16





thats bad... I have raised it on browsersync Github a few days back, but no response. github.com/BrowserSync/browser-sync/issues/579
– Tedscape
Apr 22 '15 at 4:04





3 Answers
3



I recently ran into this problem as well. I found out that my problem was not having a html5 doctype.



Do you have an html5 doctype on your page? If not, try adding one.



<!DOCTYPE html>


<!DOCTYPE html>





Hi mate, I did have it, but recently updated browser-sync again, and it all worked like magic... Not sure why it occurred. But thanks a lot again mate for the reply.
– Tedscape
Jun 18 '15 at 3:56





I would add you 100 upvotes if I could. As a newbie that is starting with these kind of tools, things like that might seem obvious for some, when they really are not for people like me. Thank you so much.
– Davdriver
Feb 4 at 12:44



I stumbled into this issue as well. When I access the URL at http://localhost:3000 in my machine and http://MY_LOCAL_IP:3000 from my device, the sync wont work. Not only scroll, but clicks and from actions as well. I've tried to change the settings from http://localhost:3001 (BS UI, a nice addition IMO) but it still won't work.



Here's my BS task:


gulp.task('browser-sync', ['default'], function()
browserSync(
server:
baseDir: './app'

);
);



Then I tried to access http://MY_LOCAL_IP:3000 both from my machine and my device, and it worked as expected. Hope this helps ;)





Hi @Aris, thanks a lot for the answer. I tried that, but works only for chrome on desktop. Does not work for chrome in mobile mode or multiple devices. The click, forms sync etc works except the scroll...
– Tedscape
Apr 22 '15 at 5:27





Really? I've tried from my 2 devices (Android/Chrome, WinPhone/IE) and it works as expected. Edit: I don't use ghostMode in my BS config. After using ghostMode scroll won't work. Try to disable it
– Aris FM
Apr 22 '15 at 5:39



ghostMode


ghostMode





I tried removing ghostmode, with no result.. WHich version of browsersync are you using?
– Tedscape
Apr 22 '15 at 6:32





Hmm strange. I use 2.6.4 too, but I'm not using vagrant.
– Aris FM
Apr 22 '15 at 6:54



I've just encountered this issue myself. Drew's answer about a missing HTML5 doctype causing the problem led me to look at my own doctype.



My doctype was there, but I had a class on the HTML tag. Removing this class restored scroll synchronisation for me. Adding the class back broke sync.



It's worth mentioning that this issue seems to occur only when a class is added to the HTML tag manually. Any classes added via DOM manipulation (using Modernizr for example) do not break scroll sync.



Running BrowserSync version 2.13.0 which is the latest version at this point in time.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS