Skip to content

Use JS for updating height of the Chat Input control#2901

Open
hellovolcano wants to merge 3 commits intomainfrom
users/vgleason/input-bug
Open

Use JS for updating height of the Chat Input control#2901
hellovolcano wants to merge 3 commits intomainfrom
users/vgleason/input-bug

Conversation

@hellovolcano
Copy link
Contributor

@hellovolcano hellovolcano commented Mar 20, 2026

Pull Request

🤨 Rationale

The Spright Chat Input is currently pulled in to an application that's being hosted in CEF 119.4.3, which does not yet have support for field-sizing as described in this bug. The long-term fix is to upgrade CEF, but we need a fix in the next few weeks before that upgrade can happen.

👩‍💻 Implementation

Use JavaScript to measure textarea's scrollHeight, compute 6-line max from resolved line-height and add padding to set the text area's inline height on when the user is adding text/resizing the text area.

Once content exceeds that max height, the logic switches the textarea to overflowY = 'auto'; otherwise it keeps overflowY = 'hidden', and it separately recalculates scrollbar width so the error icon placement stays correct when a vertical scrollbar appears.

🧪 Testing

  • Manual validation (confirmed problematic behavior in Firefox (since that property is also not supported there). Used Storybook to manually test control grows and shrinks during expected user actions.
  • Tests passing

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@hellovolcano hellovolcano changed the title Replace field-sizing with JS approach for auto growing chat input Use JS for updating height of the Chat Input control Mar 20, 2026
@hellovolcano hellovolcano marked this pull request as ready for review March 21, 2026 01:01
@hellovolcano hellovolcano requested a review from jattasNI as a code owner March 21, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant