Skip to content

Commit

Permalink
fix(vue): change isComponentPublicInstance implementation (#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
lozinsky committed Jan 16, 2024
1 parent ba3e498 commit de70c04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/large-donuts-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@floating-ui/vue": patch
---

fix: change `isComponentPublicInstance` implementation
2 changes: 1 addition & 1 deletion packages/vue/src/utils/unwrapElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {ComponentPublicInstance} from 'vue-demi';
import type {MaybeElement} from '../types';

function isComponentPublicInstance(target: unknown): target is ComponentPublicInstance {
return target != null && {}.hasOwnProperty.call(target, '$el');
return target != null && typeof target === 'object' && '$el' in target;
}

export function unwrapElement<T>(target: MaybeElement<T>) {
Expand Down

0 comments on commit de70c04

Please sign in to comment.