Skip to content

Allow selecting only directories from a data-url\file widget #4451

@TheOneTheOnlyJJ

Description

@TheOneTheOnlyJJ

Prerequisites

  • I have read the documentation

What theme are you using?

core

Is your feature request related to a problem? Please describe.

I want a data-url widget that allows users to select only directories.
I have not found any way to do it as of now.

Describe the solution you'd like

A new widget or UI Schema prop should be added that allows the user to select a directory instead of a file (or more).
This may have to wait until showDirectoryPicker becomes Baseline Newly Available.

Describe alternatives you've considered

I haven't come up with any alternative to this.
The input element does not seem like it accepts selecting directories in any way as of now.

Activity

added
featureIs a feature request
needs triageInitial label given, to be assigned correct labels and assigned
on Jan 15, 2025
changed the title [-]Allow selecting only directories from a `data-url` widget[/-] [+]Allow selecting only directories from a `data-url`/`file` widget[/+] on Jan 15, 2025
changed the title [-]Allow selecting only directories from a `data-url`/`file` widget[/-] [+]Allow selecting only directories from a `data-url`\`file` widget[/+] on Jan 15, 2025
nickgros

nickgros commented on Jan 17, 2025

@nickgros
Contributor

@TheOneTheOnlyJJ Could you do this with a custom FileWidget override, assuming you only target browsers that support showDirectoryPicker?

added and removed
needs triageInitial label given, to be assigned correct labels and assigned
on Jan 17, 2025
TheOneTheOnlyJJ

TheOneTheOnlyJJ commented on Jan 26, 2025

@TheOneTheOnlyJJ
Author

I opened this issue as I see directory selection as a good potential feature for the library.
My project in question is a local-first Electron.js app, so the Electron-specific APIs also offer local filesystem access.
I will build my own custom solution, which I will happily share when I get around to doing it.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nickgros@TheOneTheOnlyJJ

        Issue actions

          Allow selecting only directories from a `data-url`\`file` widget · Issue #4451 · rjsf-team/react-jsonschema-form