From 8ff87d285a944eec98bb86a8980a38ad7e0a10d3 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 12 Feb 2026 15:07:26 +0000 Subject: [PATCH] Fix keyboard flicker when selecting a draft in composer (#9864) (cherry picked from commit c46219bc4d55104e0cb90813f8ae89a25a6d3f09) --- src/view/com/composer/drafts/DraftsListDialog.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/view/com/composer/drafts/DraftsListDialog.tsx b/src/view/com/composer/drafts/DraftsListDialog.tsx index 834cd04cc7..9e9a72c729 100644 --- a/src/view/com/composer/drafts/DraftsListDialog.tsx +++ b/src/view/com/composer/drafts/DraftsListDialog.tsx @@ -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' @@ -53,6 +53,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) })