fix: prevent terminal from stealing focus from text inputs#1615
fix: prevent terminal from stealing focus from text inputs#1615arnestrickmann merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change prevents the terminal from stealing focus from text input fields by introducing a guard condition in the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Fixes the terminal stealing focus from text inputs (e.g. search bars, settings fields) when viewport position is restored after a re-render.
Changes
isTextInputFocused()helper that detects when the user is actively typing in a<textarea>,<input>, orcontentEditableelement (excluding the terminal's own hidden textarea)focus()to bail out when a text input is focused, preventing the terminal from hijacking keyboard inputfocus()instead of callingthis.terminal.focus()directly, so it respects the same guardsFixes #1467
Summary by CodeRabbit