fix(web): paste functionality in input fields except password inputs (#286)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: danielalves96 <62755605+danielalves96@users.noreply.github.com>
This commit is contained in:
Copilot
2025-10-09 11:32:26 -03:00
committed by GitHub
parent 92722692f9
commit fcc877738f

View File

@@ -243,8 +243,13 @@ export function GlobalDropZone({ onSuccess, children, currentFolderId }: GlobalD
const handlePaste = useCallback(
(event: ClipboardEvent) => {
event.preventDefault();
event.stopPropagation();
const target = event.target as HTMLElement;
const isInput = target.tagName === "INPUT" || target.tagName === "TEXTAREA";
const isPasswordInput = target.tagName === "INPUT" && (target as HTMLInputElement).type === "password";
if (isInput && !isPasswordInput) {
return;
}
const items = event.clipboardData?.items;
if (!items) return;
@@ -253,6 +258,9 @@ export function GlobalDropZone({ onSuccess, children, currentFolderId }: GlobalD
if (imageItems.length === 0) return;
event.preventDefault();
event.stopPropagation();
const newUploads: FileUpload[] = [];
imageItems.forEach((item) => {