Thinkmill / keystatic

First class CMS experience, TypeScript API, Markdown & YAML/JSON based, no DB
https://keystatic.com
MIT License
1.14k stars 75 forks source link

file field does not display selected filename #1140

Open stefanprobst opened 4 months ago

stefanprobst commented 4 months ago

when using a fields.file() it would be useful to display the name of the file when one has been selected. currently the widget looks like this:

Screenshot_20240516_150737

repro: https://github.com/stefanprobst/issue-keystatic-file-field

stefanprobst commented 1 month ago

i think the reason is that the file (and image) fields check useIsInDocumentEditor() which is always false (see here)

stefanprobst commented 1 month ago

@emmatown is the IsInEditorContext context a leftover from the old document field which can be removed or does it have to be added to the new richtext field as well?