chanced / filedrop-svelte

File dropzone for Svelte.
MIT License
109 stars 12 forks source link

Component Height is Hardcoded #2

Closed N0tExisting closed 2 years ago

N0tExisting commented 2 years ago

Currently the component height is hardcoded at 200px which is anoying as it is way to high for my purposes and might be to small for other people.

I've made a PR (#3)

chanced commented 2 years ago

Ah, the idea was that the default styles would only be applied if class were not provided. However, the assignment of the class isn't there and I need to add a slot.

I didn't realize that svelte doesn't recognize classes assigned to components. I'll switch it over to a slot. The default styles on the component were just meant to be a standin.

In the meantime, use the action.


<div use:filedrop={options} on:filedrop={(e) => {files = e.detail.files}}></div>
chanced commented 2 years ago

Switching it to a label is causing an issue with the action, which erroneously assumes the container is a div or some other element that doesn't propagate click to the input.

chanced commented 2 years ago

Thank you for the pr. Your changes have been published.