Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file as a type for torch_input #494

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

axelson
Copy link
Contributor

@axelson axelson commented Feb 8, 2025

Fixes a compilation warning in my app:

Compiling 25 files (.ex)
    warning: attribute "type" in component Torch.Component.torch_input/1 must be one of ["number", "checkbox", "textarea", "date", "datetime", "time", "datetime-local", "select", "text", "string"], got: "file"
    │
 12 │     <.torch_input label="Photo" field={f[:photo]} type="file" />
    │     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/my_app_web/admin/photo_schema_html/photo_schema_form.html.heex:12: (file)

The input works in my app for selecting a file.

Although should we also add all the file types listed in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types?

@cpjolicoeur cpjolicoeur merged commit a6861d0 into mojotech:master Feb 10, 2025
10 checks passed
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.

2 participants