adobe / adobe/react-spectrum

TextField can't work with <Input type='file' />

Open
#10,063 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the feature here

`` does not appear to work correctly with ``.

When a directory is selected, the native file input works correctly by itself. However, once wrapped inside ``, the control still displays “No files selected”.

```jsx

Select a directory

```

This is particularly important for RSC + Server Action workflows, because this pattern provides several advantages:

- The selected files are available directly in `onSubmit`.
- The dialog can remain a pure RSC implementation.
- Validation errors can be displayed automatically through ``.
- The flow works naturally with uncontrolled components and Server Actions.
- The dialog remains loosely coupled and can be split into multiple components when needed.

At the moment, the `Picker` component does not provide these advantages.

### 🤔 Expected Behavior?

After selecting a directory, the input should behave like a normal native file input and display something like:

```txt
12 files selected
```

### 😯 Current Behavior

After selecting a directory, the input still shows:

```txt
No files selected
```

even though the files are actually available in the form submission.

### 💁 Possible Solution

Maybe this requires:

- proper support for `` inside ``, or
- a dedicated `` component, or
- a more generic `` wrapper that works with native file inputs.

### 🔦 Context

Steps to reproduce:

1. Start the app and open `localhost:3000`.
2. Click the “Select a directory” button.
3. Select a local directory.
4. Notice that the UI still shows “No files selected”.

### 💻 Examples

_No response_

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.