Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

画像を含む過去メッセージ読み込み時にスクロールがずれる #1175

Closed
spaspa opened this issue Jun 29, 2020 · 2 comments · Fixed by #1813
Closed

画像を含む過去メッセージ読み込み時にスクロールがずれる #1175

spaspa opened this issue Jun 29, 2020 · 2 comments · Fixed by #1813
Assignees
Labels
bug Something isn't working priority:HIGH

Comments

@spaspa
Copy link
Member

spaspa commented Jun 29, 2020

  • 初期ロード時はズレが発生しない
  • 画像がなければズレが発生しない
@spaspa spaspa added the bug Something isn't working label Jun 29, 2020
@sapphi-red
Copy link
Contributor

sapphi-red commented Jul 4, 2020

composition-apiのバグがあってこのコミット(4df1b29) のあとからその影響があるのでもしかしたらバージョン上げたら直るかもしれないです
vuejs/composition-api#414

sapphi-red added a commit that referenced this issue Aug 7, 2020
書いておくとアスペクト比をブラウザ側が気にしてくれる
refs #1175 直接的な修正じゃないけど関係はする
@sapphi-red
Copy link
Contributor

sapphi-red commented Sep 25, 2020

最初に開いたチャンネルでないチャンネルに遷移したときにはstate.heightが変わらないのでそれだったりするのかも?(componentが使いまわされるので)

onMounted(() => {
state.height = rootRef.value?.scrollHeight ?? 0
})

    const route = useRoute()
    onMounted(() => {
      state.height = rootRef.value?.scrollHeight ?? 0
      if (rootRef.value) {
        rootRef.value.scrollTo({
          top: rootRef.value.scrollHeight
        })
      }
    })
    watch(
      () => route.path,
      () => {
        // vue-routerのインスタンス再利用対策
        state.height = rootRef.value?.scrollHeight ?? 0
        if (rootRef.value && props.entryMessageId === undefined) {
          rootRef.value.scrollTo({
            top: rootRef.value.scrollHeight
          })
        }
      },
      { flush: 'post' }
    )

みたいな?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:HIGH
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants