LaunchPadLab / lp-components

Our Components
http://lp-components.herokuapp.com
MIT License
5 stars 1 forks source link

Add `remove` button to default file input previews #347

Closed dpikt closed 2 years ago

dpikt commented 5 years ago

A little x that will set the value of the field back to an empty string (clear it).

chawes13 commented 2 years ago

@nicoledow Are you still interested in tackling this issue?

nicoledow commented 2 years ago

@chawes13 Thanks for reminding me - I started this but never finished. But yes, still interested, and will wrap it up this week!

chawes13 commented 2 years ago

Thanks! It might be helpful to look at how the remove button was added to address multiple file functionality that is pending in v6.

https://github.com/LaunchPadLab/lp-components/blob/7da7efea655a0716e5988eb676be68472f1d5106/src/forms/inputs/file-input/file-input.js#L237-L248

Since this is a breaking change anyways (no backwards compatibility), it probably makes sense for you to branch off of v6 and tweak that existing code to always show the button when a file exists?

nicoledow commented 2 years ago

@chawes13 just tagged you in the PR!