fix: fixes a bug with runAfterTransition getting stuck when elements are removed (#8004)
* fix: fixes a bug with runAfterTransition getting stuck when elements are suddenly removed without calling transitionend/transitioncancel.
* converts to isConnected and uses non-mock RAF for tests
* update check
---------
Co-authored-by: Daniel Lu <dl1644@gmail.com>