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
{{ message }}
Repository navigation
Add UI to allow user to delete/clear a field value #391
When editing a row in a collection, it would be great to be able to clear a field, especially an enum field specified by enumValues. Doing so would remove the field from storage of that entity. If the field is required, it should generate an error. Otherwise, it should be allowed to remove a field that's been set.
Hope this is enough information. Thanks @fgatti675 for encouraging filing an Issue.
@fgatti675 that's great! Thank you. So, now, if I set:
clearable: true
on a property, it should be able to be cleared? What does the UI look like for that?
(Sorry if this is a naive question; I'd done a
yarn add @camberi/firecms@next
and it pulled down version 2.0.0-alpha.34, and I added the above clearable flag, but I don't see any difference in the UI (i.e. I don't see a "clear" icon on my properties). What might I be doing wrong?)
Hi @fgatti675 . I just downloaded 2.0.0-alpha.37 and I still do not see a clear icon on a property that has enumValues (sorry). Other than adding the clearable: true flag, is there anything I am missing?
@fgatti675 Thank you so much for helping with this! I see that example working. I think this might be my misunderstanding about the feature. What I want to be able to do is edit an existing field to clear it. In other words, a user wants to delete a value that's already stored in the database, not clear one as they are entering a new entity (although that's a good feature too). So, in the Collection view, I want to be able to hover over a field (that's clearable) and click on "X" to clear it. Make sense?
@fgatti675 Just read the conversation above and we are looking for the same.
So, lets day the category, which is "Cameras" in the screenshot above is optional. The user can select a category or none.
Lets assume the user has selected "Cameras". Now he decides to remove the category, this is not possible now.
@fgatti675 I notice that you answered my original question. I just tried version 2.0.0-alpha.48, but I still am not able to clear a row like shown above (after adding the clearable: true property to the field). To be clear, I need to be able to do it for an existing entity.
Could I be doing something wrong?
Activity
Amtech281 commentedon Sep 28, 2022
@fgatti675 great, this would be very useful, because now we must edit changes in firestore.
By when will 2.0.0 be ready? :-)
fgatti675 commentedon Oct 5, 2022
Added the clearable prop to string, number and date properties in the latest version :)
rickpasetto commentedon Oct 6, 2022
@fgatti675 that's great! Thank you. So, now, if I set:
on a property, it should be able to be cleared? What does the UI look like for that?
(Sorry if this is a naive question; I'd done a
and it pulled down version
2.0.0-alpha.34, and I added the aboveclearableflag, but I don't see any difference in the UI (i.e. I don't see a "clear" icon on my properties). What might I be doing wrong?)fgatti675 commentedon Oct 7, 2022
Hi, it simply adds a clear icon at the end of the input field, setting the value to
nullfgatti675 commentedon Oct 7, 2022
Can you check if it work in the latest version? :)
2.0.0-alpha.35I think there was a css issue
rickpasetto commentedon Oct 7, 2022
Hi @fgatti675 . I just downloaded
2.0.0-alpha.37and I still do not see a clear icon on a property that hasenumValues(sorry). Other than adding theclearable: trueflag, is there anything I am missing?fgatti675 commentedon Oct 8, 2022
So we need to add it in multiple field bindings, it might be right in some of them but wrong in others, can you share your exact configuration?
In the demo you can see a working example for name and category
https://demo.firecms.co/c/ppp/B000P0MDMS
rickpasetto commentedon Oct 9, 2022
@fgatti675 Thank you so much for helping with this! I see that example working. I think this might be my misunderstanding about the feature. What I want to be able to do is edit an existing field to clear it. In other words, a user wants to delete a value that's already stored in the database, not clear one as they are entering a new entity (although that's a good feature too). So, in the Collection view, I want to be able to hover over a field (that's
clearable) and click on "X" to clear it. Make sense?Here's a code snippet, in case it helps:
fgatti675 commentedon Oct 10, 2022
Hi @rickpasetto
So having a clear button when a cell is selected in the collection view, that sets the value to
nullwould work for you?rickpasetto commentedon Oct 10, 2022
Yes, I think so. Something like this?

Amtech281 commentedon Oct 18, 2022
@fgatti675 Just read the conversation above and we are looking for the same.
So, lets day the category, which is "Cameras" in the screenshot above is optional. The user can select a category or none.
Lets assume the user has selected "Cameras". Now he decides to remove the category, this is not possible now.
rickpasetto commentedon Nov 1, 2022
@fgatti675 just checking in on this issue. Do you need any more information from me?
rickpasetto commentedon Dec 7, 2022
@fgatti675 I notice that you answered my original question. I just tried version
2.0.0-alpha.48, but I still am not able to clear a row like shown above (after adding theclearable: trueproperty to the field). To be clear, I need to be able to do it for an existing entity.Could I be doing something wrong?
rickpasetto commentedon Feb 6, 2023
@fgatti675 any progress on this issue? I'm still unable to clear a field of an existing row.