chore: fix save image button opening keyboard on ios
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { useApplication } from '@/Components/ApplicationProvider'
|
||||
import Icon from '@/Components/Icon/Icon'
|
||||
import Spinner from '@/Components/Spinner/Spinner'
|
||||
import { isDesktopApplication } from '@/Utils'
|
||||
import { isDesktopApplication, isIOS } from '@/Utils'
|
||||
import { BlockWithAlignableContents } from '@lexical/react/LexicalBlockWithAlignableContents'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import { classNames } from '@standardnotes/snjs'
|
||||
import { classNames, Platform } from '@standardnotes/snjs'
|
||||
import { ElementFormatType, NodeKey } from 'lexical'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { $createFileNode } from '../EncryptedFilePlugin/Nodes/FileUtils'
|
||||
@@ -80,7 +80,13 @@ const RemoteImageComponent = ({ className, src, alt, node, format, nodeKey }: Pr
|
||||
'flex items-center gap-2.5 rounded border border-border bg-default px-2.5 py-1.5',
|
||||
!isSaving && 'hover:bg-info hover:text-info-contrast',
|
||||
)}
|
||||
onClick={fetchAndUploadImage}
|
||||
onClick={() => {
|
||||
const isIOSPlatform = application.platform === Platform.Ios || isIOS()
|
||||
if (isIOSPlatform && document.activeElement) {
|
||||
;(document.activeElement as HTMLElement).blur()
|
||||
}
|
||||
fetchAndUploadImage().catch(console.error)
|
||||
}}
|
||||
disabled={isSaving}
|
||||
>
|
||||
{isSaving ? (
|
||||
|
||||
Reference in New Issue
Block a user