1) There's a UXP bug where scrollTop doesn't get updated properly when scrollHeight is reduced (UXP-10612) - this still hasn't been fixed in the last year, so we need a workaround to detect this.
2) There's a bug with scrollToItem - it uses the scrollHeight in its computation as a clip, but scrollHeight hasn't updated yet if you're switching to a different view of items as part of revealing something. This means it clips to the previous scrollHeight so doesn't actually scroll to the item.
For (2) I removed the clip so this works, but not sure if there's a better fix (e.g. don't rely on scrollHeight to get the total height)
@krisnye Two bug fixes:
1) There's a UXP bug where scrollTop doesn't get updated properly when scrollHeight is reduced (UXP-10612) - this still hasn't been fixed in the last year, so we need a workaround to detect this.
2) There's a bug with scrollToItem - it uses the scrollHeight in its computation as a clip, but scrollHeight hasn't updated yet if you're switching to a different view of items as part of revealing something. This means it clips to the previous scrollHeight so doesn't actually scroll to the item.
For (2) I removed the clip so this works, but not sure if there's a better fix (e.g. don't rely on scrollHeight to get the total height)