Fix keyboard flicker when selecting a draft in composer (#9864)

This commit is contained in:
Samuel Newman
2026-02-12 15:07:26 +00:00
committed by GitHub
parent 6d68a5bd21
commit c46219bc4d
@@ -1,5 +1,5 @@
import {useCallback, useEffect, useMemo} from 'react'
import {View} from 'react-native'
import {Keyboard, View} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -54,6 +54,12 @@ export function DraftsListDialog({
const handleSelectDraft = useCallback(
(summary: DraftSummary) => {
// Dismiss keyboard immediately to prevent flicker. Without this,
// the text input regains focus (showing the keyboard) after the
// drafts sheet closes, then loses it again when the post component
// remounts with the draft content, causing a show-hide-show cycle -sfn
Keyboard.dismiss()
control.close(() => {
onSelectDraft(summary)
})