Handle possible null element in useFocusOutside focus callback #713
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm working on another reactivity refactor here and noticed uncaught errors in radix-vue tests (despite all the tests passing): https://github.com/vuejs/ecosystem-ci/actions/runs/8029583738/job/21936045284
The root cause here is that the refactor gives computed a more correct behavior in that it will always give the latest value, even if its owner component has unmounted.
Previously, computed's effect is stopped after the owner component is unmounted, causing it to become stale and always return the last value before unmount. The refactor removed the need to "stop" a computed, and ensures that it never gets stale even when it has no subscriber.
The line in question here happens to rely on this behavior: although it checked for
element.value
at the top, afterawait nextTick()
the element computed value actually becomesnull
because the owner component unsets the dependency template ref when it unmounts.