-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Restore Missing fileInputId Property and Add acceptedFileTypes Property #1089
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of styling issues, but the changes make sense. If you can fix them I'll merge.
.DS_Store
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this file, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. I've also updated .gitignore
to help avoid this. I hope this is OK. I see it's included there in Kamal.
src/trix/config/input.js
Outdated
@@ -3,6 +3,8 @@ import { makeElement, removeNode } from "trix/core/helpers/dom" | |||
|
|||
const input = { | |||
level2Enabled: true, | |||
fileInputId: `trix-file-input-${Date.now().toString(16)}`, | |||
acceptedFileTypes: '*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer double quotes for strings. The linter should flag this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks for the quick review before. Let me know if there's anything else you want me to update here. It looks like the most recent tests failed but in a way that is unrelated to my changes. |
Is this okay to merge @afcapel ? |
@ghiculescu I afraid I don’t maintain Trix anymore, so that ‘s up to the new maintainers. |
Fixes #1088 by restoring the missing
fileInputId
property.Also adds an
acceptedFileTypes
property, similar to what was proposed in #789. That PR was opened over 3 years ago back when this code was still using CoffeeScript. I've implemented a similar change here in JavaScript, but I set this up as a simple string attribute value instead of an array. Let me know if you'd rather not have this option, but this is why I was trying to override thepickFiles
function in the first place.