Skip to content

fix(uppy): JSON-encode Array/Hash direct-upload values for Stimulus - #121

Open
thedumbtechguy wants to merge 1 commit into
masterfrom
fix/uppy-allowed-file-types-json-v064
Open

fix(uppy): JSON-encode Array/Hash direct-upload values for Stimulus#121
thedumbtechguy wants to merge 1 commit into
masterfrom
fix/uppy-allowed-file-types-json-v064

Conversation

@thedumbtechguy

Copy link
Copy Markdown
Contributor

The attachment-input controller declares allowedFileTypes (and requiredMetaFields) as Stimulus Array value types, which are read with JSON.parse. Phlex renders an array attribute value space-joined (its class-list behaviour), so allowed_file_types: [".csv", "text/csv"] reached the controller as ".csv text/csv" — JSON.parse threw on connect, after the native file input had already been hidden, leaving the user with no usable file picker. Emit structured values as JSON, matching the existing intl_tel_input options pattern.

The attachment-input controller declares allowedFileTypes (and
requiredMetaFields) as Stimulus Array value types, which are read with
JSON.parse. Phlex renders an array attribute value space-joined (its
class-list behaviour), so `allowed_file_types: [".csv", "text/csv"]`
reached the controller as ".csv text/csv" — JSON.parse threw on connect,
after the native file input had already been hidden, leaving the user with
no usable file picker. Emit structured values as JSON, matching the
existing intl_tel_input options pattern.
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.

1 participant