Skip to content

QInfiniteScroll setScrollPosition? #9150

Discussion options

You must be logged in to vote

Solved this using quasars QScrollArea

<q-scroll-area ref="chatScroll" class="full-height col q-px-md">
      <q-infinite-scroll
        v-if="chatScroll && messages.length && currentContactCard"
        reverse
        :offset="50"
        @load="load"
      >
      </q-infinite-scroll>
</q-scroll-area>

And

 const chatScroll = ref<QScrollArea | null>(null);

    watch(
      messages,
      async (newMessages) => {
        if (chatScroll.value) {
          const isClientMessage = ...;
          const scrollContainer = chatScroll.value.getScrollTarget() as HTMLDivElement;
          const isScrolledToBottom =
            scrollContainer.scrollHeight - scrollContainer.clientHeight <= scrollC…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lyle45
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by lyle45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants