소스 검색

Avoid Cannot read property 'left' of undefined at utils.setScrollPosition

function setScrollPosition ({left = 0, top = 0}) { console.log(left, top)};

setScrollPosition(undefined)

This will have TypeError
Chad Liu 6 년 전
부모
커밋
3d632fa017
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/js/fullscreen.js

+ 1 - 1
src/js/fullscreen.js

@@ -3,7 +3,7 @@ import utils from './utils';
 class FullScreen {
     constructor (player) {
         this.player = player;
-
+        this.lastScrollPosition = {left: 0, top: 0};
         this.player.events.on('webfullscreen', () => {
             this.player.resize();
         });