1

Page scrolls up after changes (include changes in css).

After css changes I see notification "Injected: style.css".
Used Firefox, Gulp 3.9.1, and Browser-sync 2.18.13.

const gulp         = require('gulp');
const browserSync  = require('browser-sync').create();

gulp.task('server', function() {
  browserSync.init({
    server: {
      baseDir: 'build/',
    },
    open: false,
    online: false,

    files:[  
        'build/*.html',
        'build/css',
        'build/js',
        'build/fonts/',
        'build/img',
    ],

    ghostMode: {
        scroll: true
    },

    logLevel: 'info', // 'debug', 'info', 'silent', 'warn'
    logConnections: false,
    logPrefix: "Browser-Sync",
    port: 8080,
    notify: true
  });
});
Skif
  • 1,178
  • 4
  • 14
  • 26
  • ghostMode scroll:true is the default. It only synchronizes the scroll positon between open devices or browsers - I don't think it has anything to do with the scroll position on a reload. So it is more of a question of how you ae reloading; you should show your sass/css task or how you call browserSync.reload preferably with {stream:true} option. – Mark Aug 25 '17 at 17:34

0 Answers0