@ionic/react 8.4.4-dev.11739312641.10060091 → 8.4.4-dev.11739906326.1989484f

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.js CHANGED
@@ -857,18 +857,6 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
857
857
  */
858
858
  this.props.onWillPresent && this.props.onWillPresent(evt);
859
859
  };
860
- this.handleWillDismiss = () => {
861
- const wrapper = this.wrapperRef.current;
862
- const el = this.ref.current;
863
- if (wrapper && el) {
864
- /**
865
- * The state is updated while the overlay is dismissing
866
- * to make sure that it sets before the overlay is removed.
867
- * This is to avoid memory leaks.
868
- */
869
- this.setState({ isOpen: false });
870
- }
871
- };
872
860
  this.handleDidDismiss = (evt) => {
873
861
  const wrapper = this.wrapperRef.current;
874
862
  const el = this.ref.current;
@@ -880,14 +868,7 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
880
868
  */
881
869
  if (wrapper && el) {
882
870
  el.append(wrapper);
883
- /**
884
- * Detach the local event listener to prevent the function
885
- * from running after the overlay has already been removed
886
- * elsewhere.
887
- * This is to avoid memory leaks when the overlay is quickly
888
- * opened and closed multiple times in succession.
889
- */
890
- el.removeEventListener('didDismiss', this.handleDidDismiss);
871
+ this.setState({ isOpen: false });
891
872
  }
892
873
  this.props.onDidDismiss && this.props.onDidDismiss(evt);
893
874
  };
@@ -901,12 +882,11 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
901
882
  this.wrapperRef = React.createRef();
902
883
  }
903
884
  componentDidMount() {
904
- var _a, _b, _c, _d;
885
+ var _a, _b, _c;
905
886
  this.componentDidUpdate(this.props);
906
887
  (_a = this.ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener('ionMount', this.handleIonMount);
907
888
  (_b = this.ref.current) === null || _b === void 0 ? void 0 : _b.addEventListener('willPresent', this.handleWillPresent);
908
889
  (_c = this.ref.current) === null || _c === void 0 ? void 0 : _c.addEventListener('didDismiss', this.handleDidDismiss);
909
- (_d = this.ref.current) === null || _d === void 0 ? void 0 : _d.addEventListener('willDismiss', this.handleWillDismiss);
910
890
  }
911
891
  componentDidUpdate(prevProps) {
912
892
  const node = this.ref.current;
@@ -943,7 +923,6 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
943
923
  * avoid memory leaks.
944
924
  */
945
925
  node.removeEventListener('didDismiss', this.handleDidDismiss);
946
- node.removeEventListener('willDismiss', this.handleWillDismiss);
947
926
  node.remove();
948
927
  detachProps(node, this.props);
949
928
  }