Shuffle icon indicating copy to clipboard operation
Shuffle copied to clipboard

Question - Custom filter for max item number

Open Nightshadelink opened this issue 1 year ago • 0 comments

          I don't think there's an easy way to do this. You'll have to use custom filters and a counter to hide any item that's past your visible counter.

Originally posted by @Vestride in https://github.com/Vestride/Shuffle/issues/270#issuecomment-464844724

How would such a Filter work? Say i have this:

function handleFilterChange(evt) {
  var input = evt.currentTarget;
  if (input.checked) {
    myShuffle.filter(input.value);
    myShuffle.sort(options);
  }
}

which filteres on value on click of the coresponding button but i want to cap the max item number to 3

Nightshadelink avatar Oct 26 '23 07:10 Nightshadelink