@tarojs/taro-h5 3.6.8 → 3.6.9-alpha.1

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.
package/dist/index.esm.js CHANGED
@@ -5611,11 +5611,13 @@ class TaroH5IntersectionObserver {
5611
5611
  const nodeList = this._options.observeAll
5612
5612
  ? this.container.querySelectorAll(targetSelector)
5613
5613
  : [this.container.querySelector(targetSelector)];
5614
- nodeList.forEach(element => {
5615
- if (!element)
5616
- return;
5617
- this._observerInst.observe(element);
5618
- this._listeners.push({ element, callback });
5614
+ Taro.nextTick(() => {
5615
+ nodeList.forEach(element => {
5616
+ if (!element)
5617
+ return;
5618
+ this._observerInst.observe(element);
5619
+ this._listeners.push({ element, callback });
5620
+ });
5619
5621
  });
5620
5622
  }
5621
5623
  relativeTo(selector, margins) {
@@ -5917,13 +5919,15 @@ class SelectorQuery {
5917
5919
  return new NodesRef('.taro_page', this, true);
5918
5920
  }
5919
5921
  exec(cb) {
5920
- queryBat(this._queue, res => {
5921
- const _queueCb = this._queueCb;
5922
- res.forEach((item, index) => {
5923
- const cb = _queueCb[index];
5924
- isFunction(cb) && cb.call(this, item);
5922
+ Taro.nextTick(() => {
5923
+ queryBat(this._queue, res => {
5924
+ const _queueCb = this._queueCb;
5925
+ res.forEach((item, index) => {
5926
+ const cb = _queueCb[index];
5927
+ isFunction(cb) && cb.call(this, item);
5928
+ });
5929
+ isFunction(cb) && cb.call(this, res);
5925
5930
  });
5926
- isFunction(cb) && cb.call(this, res);
5927
5931
  });
5928
5932
  return this;
5929
5933
  }