Repository navigation
MUL-7926 SOUR-107: Focus the composer after selecting a starter - #9132
Souredfish wants to merge 1 commit into
Conversation
Co-authored-by: multica-agent <github@multica.ai>
|
Someone is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
multica-eve
left a comment
There was a problem hiding this comment.
Selecting a conversation starter should populate and focus the composer so the user can continue typing immediately. Reusing the existing expansion trigger makes sense, but the shared focus path misses requests when the input is already laid out; please address the inline P2 before merging.
Mobile CI passes. This finding is based on the code and React Native's layout-event contract; I have not independently reproduced the native keyboard behavior on a device.
| triggerSeen.current = expandTrigger; | ||
| focusAfterInputLayout.current = true; | ||
| setExpanded(true); |
There was a problem hiding this comment.
[P2] Handle focus requests when the input is already laid out
Select a starter, dismiss the keyboard, then select the same starter again. The nonempty draft keeps the composer expanded, and neither the text nor the input's layout changes. This effect only sets the pending-focus flag and calls setExpanded(true); the actual focus() now runs exclusively from onLayout. React Native invokes onLayout on mount or layout changes, so there is no new event to consume this request and the user still has to tap the input. The shared comment composer also loses its previous automatic refocus when switching reply targets without changing the input's layout.
Please wait for layout only while the input is newly mounting/not yet laid out, and schedule focus directly when it is already ready. Verify both repeated starter selection after dismissing the keyboard and switching reply targets in an expanded composer. Event contract: https://reactnative.dev/docs/0.83/view#onlayout
Summary
@types/reactwith the workspace catalog. The lockfile already resolves it to19.2.14, so PNPM produced no lockfile diff on the clean branch.Verification
mInputShown=true).git diff --checkpassed.No production release or merge was performed.