SetFilter/Stack from Javascript

I have a Javascript query that Sets or Clears table filters based on a variable.

It works fine if the table that has the filter applied to it is visible on the screen, but there are no filter changes if the table is hidden behind a tab. I've tried both SetFilter and SetFilterStack and both exhibit the same behaviour.

Anybody else seen this? Not certain if this is a feature or a bug, but are there any workarounds?

Thanks