Using transformItems to remove the filter "No"

So I needed to remove any “No” filter from my Facets. I am using the below transform items function to remove it.

transformItems: function (items) { // Remove the No's!
  let data = [];
  items.forEach(function (e) {
    if (e.value !== 'No') {
      data.push(e);
    }
  });
  return data;
},

However the when refinementList has only one item i.e “No” and its removed the refinementList is still showing, even with nothing in it.

Does the transformItems trigger the hiding of widgets?

Hi Daniel,

When transformItems returns no objects, it hides the refinement list by default (except if you set autoHideContainer to false).

You can find an example on this sandbox.

Cheers,