@vue/compat 3.5.30 → 3.5.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.30
2
+ * @vue/compat v3.5.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1889,16 +1889,16 @@ function toRefs(object) {
1889
1889
  return ret;
1890
1890
  }
1891
1891
  class ObjectRefImpl {
1892
- constructor(_object, _key, _defaultValue) {
1892
+ constructor(_object, key, _defaultValue) {
1893
1893
  this._object = _object;
1894
- this._key = _key;
1895
1894
  this._defaultValue = _defaultValue;
1896
1895
  this["__v_isRef"] = true;
1897
1896
  this._value = void 0;
1897
+ this._key = isSymbol(key) ? key : String(key);
1898
1898
  this._raw = toRaw(_object);
1899
1899
  let shallow = true;
1900
1900
  let obj = _object;
1901
- if (!isArray(_object) || !isIntegerKey(String(_key))) {
1901
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
1902
1902
  do {
1903
1903
  shallow = !isProxy(obj) || isShallow(obj);
1904
1904
  } while (shallow && (obj = obj["__v_raw"]));
@@ -2703,6 +2703,13 @@ function checkRecursiveUpdates(seen, fn) {
2703
2703
  }
2704
2704
 
2705
2705
  let isHmrUpdating = false;
2706
+ const setHmrUpdating = (v) => {
2707
+ try {
2708
+ return isHmrUpdating;
2709
+ } finally {
2710
+ isHmrUpdating = v;
2711
+ }
2712
+ };
2706
2713
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2707
2714
  if (!!(process.env.NODE_ENV !== "production")) {
2708
2715
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -3761,9 +3768,10 @@ const TeleportImpl = {
3761
3768
  mount(container, mainAnchor);
3762
3769
  updateCssVars(n2, true);
3763
3770
  }
3764
- if (isTeleportDeferred(n2.props)) {
3771
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3765
3772
  n2.el.__isMounted = false;
3766
3773
  queuePostRenderEffect(() => {
3774
+ if (n2.el.__isMounted !== false) return;
3767
3775
  mountToTarget();
3768
3776
  delete n2.el.__isMounted;
3769
3777
  }, parentSuspense);
@@ -3771,7 +3779,12 @@ const TeleportImpl = {
3771
3779
  mountToTarget();
3772
3780
  }
3773
3781
  } else {
3774
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3782
+ n2.el = n1.el;
3783
+ n2.targetStart = n1.targetStart;
3784
+ const mainAnchor = n2.anchor = n1.anchor;
3785
+ const target = n2.target = n1.target;
3786
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3787
+ if (n1.el.__isMounted === false) {
3775
3788
  queuePostRenderEffect(() => {
3776
3789
  TeleportImpl.process(
3777
3790
  n1,
@@ -3788,11 +3801,6 @@ const TeleportImpl = {
3788
3801
  }, parentSuspense);
3789
3802
  return;
3790
3803
  }
3791
- n2.el = n1.el;
3792
- n2.targetStart = n1.targetStart;
3793
- const mainAnchor = n2.anchor = n1.anchor;
3794
- const target = n2.target = n1.target;
3795
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3796
3804
  const wasDisabled = isTeleportDisabled(n1.props);
3797
3805
  const currentContainer = wasDisabled ? container : target;
3798
3806
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -4259,7 +4267,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4259
4267
  callHook(hook, [el]);
4260
4268
  },
4261
4269
  enter(el) {
4262
- if (leavingVNodesCache[key] === vnode) return;
4270
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
4263
4271
  let hook = onEnter;
4264
4272
  let afterHook = onAfterEnter;
4265
4273
  let cancelHook = onEnterCancelled;
@@ -7470,7 +7478,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7470
7478
  return vm;
7471
7479
  }
7472
7480
  }
7473
- Vue.version = `2.6.14-compat:${"3.5.30"}`;
7481
+ Vue.version = `2.6.14-compat:${"3.5.31"}`;
7474
7482
  Vue.config = singletonApp.config;
7475
7483
  Vue.use = (plugin, ...options) => {
7476
7484
  if (plugin && isFunction(plugin.install)) {
@@ -8631,11 +8639,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
8631
8639
  }
8632
8640
  return nextProp !== prevProp;
8633
8641
  }
8634
- function updateHOCHostEl({ vnode, parent }, el) {
8642
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
8635
8643
  while (parent) {
8636
8644
  const root = parent.subTree;
8637
8645
  if (root.suspense && root.suspense.activeBranch === vnode) {
8638
- root.el = vnode.el;
8646
+ root.suspense.vnode.el = root.el = el;
8647
+ vnode = root;
8639
8648
  }
8640
8649
  if (root === vnode) {
8641
8650
  (vnode = parent.vnode).el = el;
@@ -8644,6 +8653,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
8644
8653
  break;
8645
8654
  }
8646
8655
  }
8656
+ if (suspense && suspense.activeBranch === vnode) {
8657
+ suspense.vnode.el = el;
8658
+ }
8647
8659
  }
8648
8660
 
8649
8661
  function createPropsDefaultThis(instance, rawProps, propKey) {
@@ -9584,10 +9596,17 @@ function baseCreateRenderer(options, createHydrationFns) {
9584
9596
  }
9585
9597
  hostInsert(el, container, anchor);
9586
9598
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
9599
+ const isHmr = !!(process.env.NODE_ENV !== "production") && isHmrUpdating;
9587
9600
  queuePostRenderEffect(() => {
9588
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9589
- needCallTransitionHooks && transition.enter(el);
9590
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9601
+ let prev;
9602
+ if (!!(process.env.NODE_ENV !== "production")) prev = setHmrUpdating(isHmr);
9603
+ try {
9604
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9605
+ needCallTransitionHooks && transition.enter(el);
9606
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9607
+ } finally {
9608
+ if (!!(process.env.NODE_ENV !== "production")) setHmrUpdating(prev);
9609
+ }
9591
9610
  }, parentSuspense);
9592
9611
  }
9593
9612
  };
@@ -10544,7 +10563,8 @@ function baseCreateRenderer(options, createHydrationFns) {
10544
10563
  shapeFlag,
10545
10564
  patchFlag,
10546
10565
  dirs,
10547
- cacheIndex
10566
+ cacheIndex,
10567
+ memo
10548
10568
  } = vnode;
10549
10569
  if (patchFlag === -2) {
10550
10570
  optimized = false;
@@ -10606,10 +10626,14 @@ function baseCreateRenderer(options, createHydrationFns) {
10606
10626
  remove(vnode);
10607
10627
  }
10608
10628
  }
10609
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
10629
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
10630
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
10610
10631
  queuePostRenderEffect(() => {
10611
10632
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
10612
10633
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
10634
+ if (shouldInvalidateMemo) {
10635
+ vnode.el = null;
10636
+ }
10613
10637
  }, parentSuspense);
10614
10638
  }
10615
10639
  };
@@ -11172,6 +11196,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11172
11196
  pendingId: suspenseId++,
11173
11197
  timeout: typeof timeout === "number" ? timeout : -1,
11174
11198
  activeBranch: null,
11199
+ isFallbackMountPending: false,
11175
11200
  pendingBranch: null,
11176
11201
  isInFallback: !isHydrating,
11177
11202
  isHydrating,
@@ -11221,7 +11246,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11221
11246
  }
11222
11247
  };
11223
11248
  }
11224
- if (activeBranch) {
11249
+ if (activeBranch && !suspense.isFallbackMountPending) {
11225
11250
  if (parentNode(activeBranch.el) === container2) {
11226
11251
  anchor = next(activeBranch);
11227
11252
  }
@@ -11234,6 +11259,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11234
11259
  move(pendingBranch, container2, anchor, 0);
11235
11260
  }
11236
11261
  }
11262
+ suspense.isFallbackMountPending = false;
11237
11263
  setActiveBranch(suspense, pendingBranch);
11238
11264
  suspense.pendingBranch = null;
11239
11265
  suspense.isInFallback = false;
@@ -11269,6 +11295,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11269
11295
  triggerEvent(vnode2, "onFallback");
11270
11296
  const anchor2 = next(activeBranch);
11271
11297
  const mountFallback = () => {
11298
+ suspense.isFallbackMountPending = false;
11272
11299
  if (!suspense.isInFallback) {
11273
11300
  return;
11274
11301
  }
@@ -11288,6 +11315,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11288
11315
  };
11289
11316
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11290
11317
  if (delayEnter) {
11318
+ suspense.isFallbackMountPending = true;
11291
11319
  activeBranch.transition.afterLeave = mountFallback;
11292
11320
  }
11293
11321
  suspense.isInFallback = true;
@@ -11905,6 +11933,10 @@ function mergeProps(...args) {
11905
11933
  const incoming = toMerge[key];
11906
11934
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
11907
11935
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
11936
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
11937
+ // the model listener.
11938
+ !isModelListener(key)) {
11939
+ ret[key] = incoming;
11908
11940
  }
11909
11941
  } else if (key !== "") {
11910
11942
  ret[key] = toMerge[key];
@@ -12615,7 +12647,7 @@ function isMemoSame(cached, memo) {
12615
12647
  return true;
12616
12648
  }
12617
12649
 
12618
- const version = "3.5.30";
12650
+ const version = "3.5.31";
12619
12651
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12620
12652
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12621
12653
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -14303,7 +14335,8 @@ const vModelText = {
14303
14335
  if (elValue === newValue) {
14304
14336
  return;
14305
14337
  }
14306
- if (document.activeElement === el && el.type !== "range") {
14338
+ const rootNode = el.getRootNode();
14339
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
14307
14340
  if (lazy && value === oldValue) {
14308
14341
  return;
14309
14342
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.30
2
+ * @vue/compat v3.5.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1882,16 +1882,16 @@ var Vue = (function () {
1882
1882
  return ret;
1883
1883
  }
1884
1884
  class ObjectRefImpl {
1885
- constructor(_object, _key, _defaultValue) {
1885
+ constructor(_object, key, _defaultValue) {
1886
1886
  this._object = _object;
1887
- this._key = _key;
1888
1887
  this._defaultValue = _defaultValue;
1889
1888
  this["__v_isRef"] = true;
1890
1889
  this._value = void 0;
1890
+ this._key = isSymbol(key) ? key : String(key);
1891
1891
  this._raw = toRaw(_object);
1892
1892
  let shallow = true;
1893
1893
  let obj = _object;
1894
- if (!isArray(_object) || !isIntegerKey(String(_key))) {
1894
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
1895
1895
  do {
1896
1896
  shallow = !isProxy(obj) || isShallow(obj);
1897
1897
  } while (shallow && (obj = obj["__v_raw"]));
@@ -2691,6 +2691,13 @@ var Vue = (function () {
2691
2691
  }
2692
2692
 
2693
2693
  let isHmrUpdating = false;
2694
+ const setHmrUpdating = (v) => {
2695
+ try {
2696
+ return isHmrUpdating;
2697
+ } finally {
2698
+ isHmrUpdating = v;
2699
+ }
2700
+ };
2694
2701
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2695
2702
  {
2696
2703
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -3718,9 +3725,10 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3718
3725
  mount(container, mainAnchor);
3719
3726
  updateCssVars(n2, true);
3720
3727
  }
3721
- if (isTeleportDeferred(n2.props)) {
3728
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3722
3729
  n2.el.__isMounted = false;
3723
3730
  queuePostRenderEffect(() => {
3731
+ if (n2.el.__isMounted !== false) return;
3724
3732
  mountToTarget();
3725
3733
  delete n2.el.__isMounted;
3726
3734
  }, parentSuspense);
@@ -3728,7 +3736,12 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3728
3736
  mountToTarget();
3729
3737
  }
3730
3738
  } else {
3731
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3739
+ n2.el = n1.el;
3740
+ n2.targetStart = n1.targetStart;
3741
+ const mainAnchor = n2.anchor = n1.anchor;
3742
+ const target = n2.target = n1.target;
3743
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3744
+ if (n1.el.__isMounted === false) {
3732
3745
  queuePostRenderEffect(() => {
3733
3746
  TeleportImpl.process(
3734
3747
  n1,
@@ -3745,11 +3758,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3745
3758
  }, parentSuspense);
3746
3759
  return;
3747
3760
  }
3748
- n2.el = n1.el;
3749
- n2.targetStart = n1.targetStart;
3750
- const mainAnchor = n2.anchor = n1.anchor;
3751
- const target = n2.target = n1.target;
3752
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3753
3761
  const wasDisabled = isTeleportDisabled(n1.props);
3754
3762
  const currentContainer = wasDisabled ? container : target;
3755
3763
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -4215,7 +4223,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4215
4223
  callHook(hook, [el]);
4216
4224
  },
4217
4225
  enter(el) {
4218
- if (leavingVNodesCache[key] === vnode) return;
4226
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
4219
4227
  let hook = onEnter;
4220
4228
  let afterHook = onAfterEnter;
4221
4229
  let cancelHook = onEnterCancelled;
@@ -7404,7 +7412,7 @@ If this is a native custom element, make sure to exclude it from component resol
7404
7412
  return vm;
7405
7413
  }
7406
7414
  }
7407
- Vue.version = `2.6.14-compat:${"3.5.30"}`;
7415
+ Vue.version = `2.6.14-compat:${"3.5.31"}`;
7408
7416
  Vue.config = singletonApp.config;
7409
7417
  Vue.use = (plugin, ...options) => {
7410
7418
  if (plugin && isFunction(plugin.install)) {
@@ -8563,11 +8571,12 @@ If you want to remount the same app, move your app creation logic into a factory
8563
8571
  }
8564
8572
  return nextProp !== prevProp;
8565
8573
  }
8566
- function updateHOCHostEl({ vnode, parent }, el) {
8574
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
8567
8575
  while (parent) {
8568
8576
  const root = parent.subTree;
8569
8577
  if (root.suspense && root.suspense.activeBranch === vnode) {
8570
- root.el = vnode.el;
8578
+ root.suspense.vnode.el = root.el = el;
8579
+ vnode = root;
8571
8580
  }
8572
8581
  if (root === vnode) {
8573
8582
  (vnode = parent.vnode).el = el;
@@ -8576,6 +8585,9 @@ If you want to remount the same app, move your app creation logic into a factory
8576
8585
  break;
8577
8586
  }
8578
8587
  }
8588
+ if (suspense && suspense.activeBranch === vnode) {
8589
+ suspense.vnode.el = el;
8590
+ }
8579
8591
  }
8580
8592
 
8581
8593
  function createPropsDefaultThis(instance, rawProps, propKey) {
@@ -9489,10 +9501,17 @@ If you want to remount the same app, move your app creation logic into a factory
9489
9501
  }
9490
9502
  hostInsert(el, container, anchor);
9491
9503
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
9504
+ const isHmr = isHmrUpdating;
9492
9505
  queuePostRenderEffect(() => {
9493
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9494
- needCallTransitionHooks && transition.enter(el);
9495
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9506
+ let prev;
9507
+ prev = setHmrUpdating(isHmr);
9508
+ try {
9509
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9510
+ needCallTransitionHooks && transition.enter(el);
9511
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9512
+ } finally {
9513
+ setHmrUpdating(prev);
9514
+ }
9496
9515
  }, parentSuspense);
9497
9516
  }
9498
9517
  };
@@ -10438,7 +10457,8 @@ If you want to remount the same app, move your app creation logic into a factory
10438
10457
  shapeFlag,
10439
10458
  patchFlag,
10440
10459
  dirs,
10441
- cacheIndex
10460
+ cacheIndex,
10461
+ memo
10442
10462
  } = vnode;
10443
10463
  if (patchFlag === -2) {
10444
10464
  optimized = false;
@@ -10500,10 +10520,14 @@ If you want to remount the same app, move your app creation logic into a factory
10500
10520
  remove(vnode);
10501
10521
  }
10502
10522
  }
10503
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
10523
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
10524
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
10504
10525
  queuePostRenderEffect(() => {
10505
10526
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
10506
10527
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
10528
+ if (shouldInvalidateMemo) {
10529
+ vnode.el = null;
10530
+ }
10507
10531
  }, parentSuspense);
10508
10532
  }
10509
10533
  };
@@ -11066,6 +11090,7 @@ If you want to remount the same app, move your app creation logic into a factory
11066
11090
  pendingId: suspenseId++,
11067
11091
  timeout: typeof timeout === "number" ? timeout : -1,
11068
11092
  activeBranch: null,
11093
+ isFallbackMountPending: false,
11069
11094
  pendingBranch: null,
11070
11095
  isInFallback: !isHydrating,
11071
11096
  isHydrating,
@@ -11115,7 +11140,7 @@ If you want to remount the same app, move your app creation logic into a factory
11115
11140
  }
11116
11141
  };
11117
11142
  }
11118
- if (activeBranch) {
11143
+ if (activeBranch && !suspense.isFallbackMountPending) {
11119
11144
  if (parentNode(activeBranch.el) === container2) {
11120
11145
  anchor = next(activeBranch);
11121
11146
  }
@@ -11128,6 +11153,7 @@ If you want to remount the same app, move your app creation logic into a factory
11128
11153
  move(pendingBranch, container2, anchor, 0);
11129
11154
  }
11130
11155
  }
11156
+ suspense.isFallbackMountPending = false;
11131
11157
  setActiveBranch(suspense, pendingBranch);
11132
11158
  suspense.pendingBranch = null;
11133
11159
  suspense.isInFallback = false;
@@ -11163,6 +11189,7 @@ If you want to remount the same app, move your app creation logic into a factory
11163
11189
  triggerEvent(vnode2, "onFallback");
11164
11190
  const anchor2 = next(activeBranch);
11165
11191
  const mountFallback = () => {
11192
+ suspense.isFallbackMountPending = false;
11166
11193
  if (!suspense.isInFallback) {
11167
11194
  return;
11168
11195
  }
@@ -11182,6 +11209,7 @@ If you want to remount the same app, move your app creation logic into a factory
11182
11209
  };
11183
11210
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11184
11211
  if (delayEnter) {
11212
+ suspense.isFallbackMountPending = true;
11185
11213
  activeBranch.transition.afterLeave = mountFallback;
11186
11214
  }
11187
11215
  suspense.isInFallback = true;
@@ -11799,6 +11827,10 @@ Component that was made reactive: `,
11799
11827
  const incoming = toMerge[key];
11800
11828
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
11801
11829
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
11830
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
11831
+ // the model listener.
11832
+ !isModelListener(key)) {
11833
+ ret[key] = incoming;
11802
11834
  }
11803
11835
  } else if (key !== "") {
11804
11836
  ret[key] = toMerge[key];
@@ -12481,7 +12513,7 @@ Component that was made reactive: `,
12481
12513
  return true;
12482
12514
  }
12483
12515
 
12484
- const version = "3.5.30";
12516
+ const version = "3.5.31";
12485
12517
  const warn = warn$1 ;
12486
12518
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12487
12519
  const devtools = devtools$1 ;
@@ -14138,7 +14170,8 @@ Expected function or array of functions, received type ${typeof value}.`
14138
14170
  if (elValue === newValue) {
14139
14171
  return;
14140
14172
  }
14141
- if (document.activeElement === el && el.type !== "range") {
14173
+ const rootNode = el.getRootNode();
14174
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
14142
14175
  if (lazy && value === oldValue) {
14143
14176
  return;
14144
14177
  }