Skip to content

@ai-sdk/solid: New chat message forces the chat window to scroll to the top #5411

Closed
@ian-pascoe

Description

@ian-pascoe

Description

  1. Go to the solid openai chat example
  2. Run via pnpm run dev
  3. Go to any of the chat pages
  4. Generate enough messages to have to scroll within the chat window
  5. Notice when submitting a new message that the window resets to the top scroll position

Code example

No response

AI provider

@ai-sdk/solid - latest

Additional context

Normally I would submit a fix for a problem like this but I am short on time and cannot.

My guesses for why this is happening is due to the way the chat messages are updating. SolidJS uses referential equality in their <For /> component so if the messages list is being recomputed via a spread operator, it could cause a complete rerender which would cause the scrolling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions