Skip to content

fix(prompt-input): match file extension patterns in accept - #502

Open
HardMax71 wants to merge 1 commit into
vercel:mainfrom
HardMax71:fix/prompt-input-accept-extensions
Open

HardMax71 wants to merge 1 commit into
vercel:mainfrom
HardMax71:fix/prompt-input-accept-extensions

Conversation

@HardMax71

Copy link
Copy Markdown

matchesAccept now treats an accept entry that starts with "." as a file extension and matches it against the file name, case-insensitive, as the native file input does. MIME patterns (image/*, application/pdf) work as before. I also updated the accept docs and prop comment and added a changeset.

New test in __tests__/prompt-input.test.tsx, "matches file extension patterns against the file name": with accept=".xlsx, .csv", a report.xlsx with an empty type and a DATA.CSV with application/octet-stream are added and notes.txt is rejected with code: "accept". It fails on main and passes here. The full @repo/elements suite passes (959 tests).

Closes #501

An accept entry like .xlsx never matched in matchesAccept, which only
compares MIME types, so files allowed by the file dialog were dropped
when added, pasted or dropped. Extension patterns are now matched
against the file name, case-insensitive, as the HTML accept attribute
does.
@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@HardMax71 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PromptInput rejects every file when accept lists file extensions (".xlsx")

1 participant