Once a value has been selected in the dropdown, it is not possible to de-select it.
Once a value has been selected in the dropdown it shows up as text on the button and as the only item in the dropdown.
It is not possible to de-select it or to reset the facet except by re-loading the page, thereby loosing all other values chosen in other facets on a page with faceted search.
One option would be to add an item in the dropdown with something like "Undo" - something like the reverse to the "Choose" before a value was choosen.
Another option would be a checkbox that can be un-ticked, similar to the display of "Links with checkboxes". This option would provide the same user experience as the links with checkboxes, for example on a faceted search page, where the user gets a combination of dropdown (for example for choosing a country out of a long list) and checkboxes for other values.

![]()

| Comment | File | Size | Author |
|---|---|---|---|
| #34 | drodown_selected.png | 9.02 KB | Chipie |
| #34 | initial_dropdown.png | 13.33 KB | Chipie |
| #31 | facetapi_select-2336857-31.patch | 11.21 KB | grndlvl |
| #28 | facetapi_select-2336857-28.patch | 0 bytes | grndlvl |
| #26 | facetapi_select-2336857-26.patch | 10.63 KB | grndlvl |
Comments
Comment #1
jcam88 commentedSame issue here. No way to unselect. An alternative is to provide an "all" option that resets the filter.
Comment #2
erikwebb commentedComment #3
rooby commentedThis issue seems related: #2118323: Add default option when facet is active
I won't close either of them as I don't know for sure but it seems a lot of work has gone on in that other issue.
Comment #4
danepowell commentedThink the patch in #2 forgot to update one variable. Fixed here.
Comment #5
irowboat commented#4 seems to work! Nice job.
Comment #6
rcodinaPatch on #4 works for me too!
Comment #7
mvwensen commentedPatch #4 seems to work for me!
Comment #8
maxplus commentedThanks,
#4 works great for me!
Comment #9
jackbravo commented#4 works great for us too, but we wanted to be able to use HTML inside the link so we could use stuff like fontawesome. So we have an updated patch with just one line change adding 'html' => TRUE to the $options array.
Comment #10
rooby commentedI think it would be better to have the whole link markup themeable.
Something along these lines (I have left out theme function params, this is just to illustrate what I mean):
Then implement theme_facetapi_select_deactivate_link().
That way you can override the markup.
Otherwise there is still a portion of the markup that is not really overridable except in theory via form alter, however then you would run into #2136831: Use drupal_get_form() when retrieving the select options form
Comment #11
maxplus commentedHi,
I was looking for the origin of the (-), because I wanted it to change to something more readable, like reset or something similar.
For anyone who also want to change this reset link, is is found inside the facetapi module, inside facetapi.theme.inc
function theme_facetapi_deactivate_widget($variables) {
return '(-)';
}
Comment #12
danepowell commentedPatch in #9 was malformed, here it is corrected.
Comment #13
StevenWill commentedTested patch #12 and it works.
Comment #14
bisonbleu commentedPatch in #12 works for me. Thanks all!
Comment #15
grndlvl commentedDoesn't account for facets that can have multiple selections.
Example: Tags
Node 1: apple, oranges
Node 2: apple
When filtering by apple we see the two nodes as appropriate and can reset from this state as expected, however, when we also filter by apple & oranges the (-) only undoes the latest which can be confusing as the user has no idea which facet is being "Reset".
Comment #16
grndlvl commentedOk, to remedy the issue I mentioned above I expanded on the active items list. Instead of adding just (-) above the select. I went head and made a list of active items, much like the list facet.
Thoughts?
See screenshot: https://www.drupal.org/files/issues/Selection_012_0.jpg
Comment #18
grndlvl commentedComment #19
EsmeraldaUBM commentedComment #20
EsmeraldaUBM commentedComment #21
Anonymous (not verified) commentedHello there!
I was looking at moving to the latest dev version and when I was testing it out I had originally patched it with patch #5 on https://www.drupal.org/node/2118323 but I noticed that it was closed out in favor of using this fix. To me it seems odd to fix this by having a reset link with a (-) attached when the whole point of having a select list is to avoid having links. Wouldn't it be better to have an option within the list that is "- Reset -" or "- Show all -" that will reset the list which is what that other patch accomplished. I think it would look more cohesive both if you have it styled vertically within a column or horizontally in which case you would want to avoid having a floating link above the select list.
Something similar to the image below where it is part of the select list would look much more cohesive:
Comment #22
grndlvl commentedHmm, good point. Though, we should account for items that are hierarchical.
States that would need to be covered.
* Hierarchy with children using AND/OR (not-expanded -- children are revealed when the parent is selected)
* Hierarchy with children using AND/OR (expanded)
* Non-hierarchical AND/OR
The "- Show all -" I believe is something we'll want to make configurable as a reset all item that is added to the list when set.
I'll try to upload some possible ideas of how these would look using a select only approach.
Comment #23
grndlvl commentedHow about this?
Where the bolded items are the selected items. We'd probably want a better way to denote that they are selected+deselectable.
Comment #24
grndlvl commentedAfter spending some some more time on this I am drawing a blank on how to accomplish this.
The issue being that the reset URL is duplicated for the options. This works with the links since it's well links and has children. Open to suggestions here.
Comment #25
jody lynnI think the UI in #21 is ideal. It's less important to allow deselecting specific items here than it is to keep the UI simple (which is the whole purpose of the module). So I think what we should do is when you choose the 'Default option label' from the select that it resets any and all selections on its facet. In the case where someone needs to deselect one item (like in a hierarchy), they will have to deselect the whole facet and then drill back down. If that's a big problem for someone then they may want to use facetapi_multiselect instead.
Comment #26
grndlvl commentedAfter much head and wall action I have given up on the hierarchical solutions. If anyone is searching for such features checkout Facetapi Multiselect. With that I have cut this down to only support single tier terms and dates. I have also fixed #2619960: [UX] Keep single select value if Facet is configured as "Limit to one active item" as a result of this work.
I have done away with the deselect links completely.
Comment #27
markandrewsuttonPatch in #26 works as expected and was very helpful for my case. Thank You!
Comment #28
grndlvl commentedMade a minor change so that when the option "Limit to one active item" so that the "( - )" doesn't show up next to the selected item since only one active item can show.
Comment #30
grndlvl commentedComment #31
grndlvl commentedHeh here is the actual patch.
Comment #32
Chipie commentedCurrently the user has to to click on the Reset Label first if he wants to select another value.
Would it be also possible to display all values, so you chose another value without reseting the filter first, so it should look like the image in #26:
Comment #33
grndlvl commentedChipie,
Could you describe how to setup this situation? During my testing this certainly was not the case.
Comment #34
Chipie commented@grndlvl,
the initial dropdown looks like this:
after selecting one option (e.g. "Leaders"), the other vales are not shown any more:
In order to choose another option, the user has to click on the rest option label ("Alle") first, before he can chose another option.
If the dropdown looks like this
the user would be able to chose another option, without having to reset the filter first.
Comment #35
grndlvl commentedI believe this is a configuration error. I am pretty sure you need to set it as "OR" instead of "AND" and you should be good. I will double check this when I get a chance.
Comment #36
Chipie commentedYou are correct. After setting the operator from AND to OR, I am getting the display, I wanted to have.
Thank you so much for your help.
Comment #37
grndlvl commentedGood to hear. Thanks for testing and the feedback.
Comment #38
twodThis change completely broke the widget for hierarchies. It's no longer possible to select any term below the first level as they are never shown.
We have a short and pretty shallow vocabulary to show so we want all terms to be shown all the time, but we can only get that if we flatten the hierarchy, which looks really confusing.
Why was this
appendChildren()call and the entireshouldExpandChildren()logic removed? It appears completely irrelevant to the original bug report.This part makes no sense (
$itemcan be undefined here).Comment #39
twodHere's a patch which restores the hierarchy.
Comment #40
grndlvl commented@TwoD The hierarchy causes more issues that it solves. If you would like to discuss hierarchy please create a new ticket otherwise you may use https://www.drupal.org/project/facetapi_multiselect
Comment #41
twod@grndlvl, seriously? That module is overly complicated and completely breaks hierarchies. It turns the parent terms into optgroups, making them unselectable and thus the whole widget becomes pointless because it does not actually let me pick from all available terms.
I brought it up here because this issue introduced a major regression in functionality without a word about intending to do so...
Comment #42
grndlvl commented@TwoD this module never was released with the hierarchy in it and was something we were looking to add, but after much aggravation to actually have it work as expected decided against it. If you would like to add this feature back properly let's open a ticket to do so.
I am also on IRC if you would like to discuss further.
Thanks.
Comment #43
grndlvl commented