Skip to content

Commit

Permalink
fix(cdk:popper): vue warning when watch on non-reactive options (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Oct 13, 2022
1 parent 1406d27 commit 123e62f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/cdk/popper/src/composables/useOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { PopperOptions } from '../types'

import { type ComputedRef, computed, reactive, watch } from 'vue'
import { type ComputedRef, computed, isReactive, reactive, watch } from 'vue'

import { isEqual } from 'lodash-es'

Expand Down Expand Up @@ -39,9 +39,11 @@ export function usePopperOptions(options: PopperOptions): {
})
}

watch(options, _options => {
updateOptions(_options)
})
if (isReactive(options)) {
watch(options, _options => {
updateOptions(_options)
})
}

return {
popperOptions,
Expand Down

0 comments on commit 123e62f

Please sign in to comment.