You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While overriding the pickFiles function, I noticed that there is no fileInputId property to provide a unique ID for the dynamically inserted file input element.
Back in Trix version 1, that existed here and looked like:
The entire pickFiles function was removed here. Then that function was added back without fileInputIdhere.
This means that if for some strange reason you had another element on the page with an id of "undefined", clicking to add a file in Trix would remove that element.
Also, as a side question--would you be open to a pull request that adds a way to configure the accept property on the pickFiles input element? I need to restrict the types of files a user can select. I know I can check the file type in the trix-file-accept event and call event.preventDefault() there, but that happens after the user has already selected a file. It would be nice to be able to restrict the list of possible files while they are making the selection. (Update: I now see pull request #789 addresses this and has been open for over 3 years.)
Details
Trix version: 2.0.5
The text was updated successfully, but these errors were encountered:
While overriding the
pickFiles
function, I noticed that there is nofileInputId
property to provide a unique ID for the dynamically inserted file input element.Back in Trix version 1, that existed here and looked like:
The entire
pickFiles
function was removed here. Then that function was added back withoutfileInputId
here.This means that if for some strange reason you had another element on the page with an
id
of "undefined", clicking to add a file in Trix would remove that element.Also, as a side question--would you be open to a pull request that adds a way to configure the
accept
property on thepickFiles
input element? I need to restrict the types of files a user can select. I know I can check the file type in thetrix-file-accept
event and callevent.preventDefault()
there, but that happens after the user has already selected a file. It would be nice to be able to restrict the list of possible files while they are making the selection. (Update: I now see pull request #789 addresses this and has been open for over 3 years.)Details
The text was updated successfully, but these errors were encountered: