Skip to content

fix: Prevent height hook from running in token-mode when value prop changes#4513

Merged
ernst-dev merged 1 commit into
mainfrom
dev-v3-ernstka-prompt-input-value-hook-issue
May 13, 2026
Merged

fix: Prevent height hook from running in token-mode when value prop changes#4513
ernst-dev merged 1 commit into
mainfrom
dev-v3-ernstka-prompt-input-value-hook-issue

Conversation

@ernst-dev
Copy link
Copy Markdown
Member

Description

When providing both value and tokens, updating the value prop results in the adjustHeight hook running and affecting the caret position. This PR separates the useEffect so it can run independently when in either mode, this way value updates don't affect token mode and vice versa.

Related links, issue #, if available: AWSUI-61987

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ernst-dev ernst-dev requested a review from pan-kot May 12, 2026 14:27
@ernst-dev ernst-dev requested a review from a team as a code owner May 12, 2026 14:27
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.42%. Comparing base (1cfdac5) to head (169de5b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4513   +/-   ##
=======================================
  Coverage   97.42%   97.42%           
=======================================
  Files         936      936           
  Lines       29615    29616    +1     
  Branches    10761    10760    -1     
=======================================
+ Hits        28851    28852    +1     
- Misses        716      757   +41     
+ Partials       48        7   -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ernst-dev ernst-dev added this pull request to the merge queue May 13, 2026
Merged via the queue into main with commit ebb4068 May 13, 2026
57 of 58 checks passed
@ernst-dev ernst-dev deleted the dev-v3-ernstka-prompt-input-value-hook-issue branch May 13, 2026 09:56
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.

2 participants