fix: allow text paste on iOS by checking clipboard text before files (#64)

This commit is contained in:
Naman Rajpal authored and GitHub committed 2026-01-15 20:53:48 -05:00
1 parent 9efcbc5688
commit 1e4b756973
1 file changed
+8
@@ -420,6 +420,14 @@ export const PromptInput = forwardRef<PromptInputHandle, PromptInputProps>(funct
const isSecureContext = window.isSecureContext || (window.location.protocol === 'http:' && window.location.hostname === 'localhost')
if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) {
try {
const text = await navigator.clipboard.readText()
if (text && text.trim()) {
return
}
} catch (err) {
}
event.preventDefault()
try {
const clipboardItems = await navigator.clipboard.read()