Tax Question - ISA treatment when moving abroad

Boring tax question time, one for you experts out there.

Let’s say that in a hypothetical scenario you have your money investing happily tax free in a S&S ISA account being a UK tax resident.

Then you decide to move out of the UK and your tax residence changes to the new country. You can still keep the ISA just no longer contribute to it.

Assuming that the capital gains & dividends are tax free for the UK, are they also tax free for the new country you moved in or are they subject to their local tax rules? Does it matter at all that at time of purchase your tax residence was the UK?

Does the same apply for capital gains registered under EIS?