Files
orca/mobile/src/session/markdown-floating-actions-layout.ts
T
Jinjing 2b1e69d4b0 Add keyboard dismissal for mobile markdown editor (#13856)
* fix(mobile-markdown): enable keyboard dismissal while editing

Allow users to dismiss the soft keyboard while composing markdown content. Extract the MarkdownReader component into its own file and add WebView-based caret preservation to restore the cursor position after the keyboard closes. This prevents the editor from losing focus and erasing the user's selected caret location when the keyboard hides.

* improve test
2026-08-11 13:08:50 -07:00

28 lines
600 B
TypeScript

export function resolveMarkdownFloatingActionsBottom({
keyboardLift,
restingBottom,
liftedClearance
}: {
keyboardLift: number
restingBottom: number
liftedClearance: number
}): number {
return keyboardLift > 0 ? keyboardLift + liftedClearance : restingBottom
}
export function shouldShowMarkdownFloatingActions({
keyboardLift,
hasStatus,
showRefresh,
showCopy,
showSave
}: {
keyboardLift: number
hasStatus: boolean
showRefresh: boolean
showCopy: boolean
showSave: boolean
}): boolean {
return keyboardLift > 0 || hasStatus || showRefresh || showCopy || showSave
}