mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
* 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
28 lines
600 B
TypeScript
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
|
|
}
|