Skip to content

MessageContent: replace overflow-hidden with overflow-x-clip to preserve sticky positioning #420

Description

@hebo-agent

Description

`MessageContent` currently uses `overflow-hidden` on its root div. Per CSS spec, `overflow: hidden` creates a scroll container, which breaks `position: sticky` for any descendants (e.g., code block action buttons rendered by streamdown or similar markdown renderers).

Proposal

Replace `overflow-hidden` with `overflow-x-clip` on the `MessageContent` root div.

Why `overflow-x-clip`?

  • `overflow: clip` does not create a scroll container (unlike `overflow: hidden`), so `sticky` positioning continues to work for descendants
  • It still clips wide content (long URLs, inline code) from overflowing the message bubble horizontally
  • `overflow-x-clip` specifically targets the horizontal axis, leaving vertical overflow unaffected

Suggested change

```diff

  • "... overflow-hidden text-sm",
  • "... overflow-x-clip text-sm",
    ```

Context

We discovered this while debugging unclickable code block buttons in a chat UI. While the root cause turned out to be a separate issue with `sticky` + `pointer-events-none` in nested scroll containers, the `overflow-hidden` → `overflow-x-clip` change is independently valuable as a layout improvement that preserves sticky positioning for any future descendants that need it.

Browser support

`overflow: clip` is supported in all modern browsers (Chrome 90+, Firefox 81+, Safari 16+).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions