@royaloperahouse/harmonic 0.18.3-e → 0.18.3-f

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.
@@ -5895,7 +5895,6 @@ var Accordion = function Accordion(_ref) {
5895
5895
  var _useState3 = React.useState(initOpen ? expandedStateIconData : collapsedStateIconData),
5896
5896
  icon = _useState3[0],
5897
5897
  setIcon = _useState3[1];
5898
- // Contents children visibility is set to prevent it from being keyboard tabbable when the accordion is closed
5899
5898
  var _useState4 = React.useState(initOpen),
5900
5899
  childrenVisibility = _useState4[0],
5901
5900
  setChildrenVisibility = _useState4[1];
@@ -5903,6 +5902,7 @@ var Accordion = function Accordion(_ref) {
5903
5902
  var timeoutRef = React.useRef(null);
5904
5903
  var rafRef = React.useRef(null);
5905
5904
  var resizeObserverRef = React.useRef(null);
5905
+ var intervalRef = React.useRef(null);
5906
5906
  React.useEffect(function () {
5907
5907
  if (content.current && initOpen) {
5908
5908
  setTextHeight(content.current.scrollHeight + "px");
@@ -5917,22 +5917,44 @@ var Accordion = function Accordion(_ref) {
5917
5917
  resizeObserverRef.current.disconnect();
5918
5918
  resizeObserverRef.current = null;
5919
5919
  }
5920
+ if (intervalRef.current) {
5921
+ window.clearInterval(intervalRef.current);
5922
+ intervalRef.current = null;
5923
+ }
5924
+ if (rafRef.current) {
5925
+ window.cancelAnimationFrame(rafRef.current);
5926
+ rafRef.current = null;
5927
+ }
5920
5928
  return;
5921
5929
  }
5922
5930
  var updateHeight = function updateHeight() {
5923
5931
  setTextHeight(el.scrollHeight + "px");
5924
5932
  };
5925
5933
  rafRef.current = window.requestAnimationFrame(updateHeight);
5926
- if ('ResizeObserver' in window) {
5934
+ if (typeof ResizeObserver !== 'undefined') {
5927
5935
  var ro = new ResizeObserver(updateHeight);
5928
5936
  ro.observe(el);
5929
5937
  resizeObserverRef.current = ro;
5938
+ intervalRef.current = window.setInterval(updateHeight, 200);
5930
5939
  return function () {
5931
5940
  ro.disconnect();
5932
5941
  resizeObserverRef.current = null;
5942
+ if (intervalRef.current) {
5943
+ window.clearInterval(intervalRef.current);
5944
+ intervalRef.current = null;
5945
+ }
5946
+ if (rafRef.current) {
5947
+ window.cancelAnimationFrame(rafRef.current);
5948
+ rafRef.current = null;
5949
+ }
5933
5950
  };
5934
5951
  }
5952
+ intervalRef.current = window.setInterval(updateHeight, 200);
5935
5953
  return function () {
5954
+ if (intervalRef.current) {
5955
+ window.clearInterval(intervalRef.current);
5956
+ intervalRef.current = null;
5957
+ }
5936
5958
  if (rafRef.current) {
5937
5959
  window.cancelAnimationFrame(rafRef.current);
5938
5960
  rafRef.current = null;
@@ -5953,6 +5975,10 @@ var Accordion = function Accordion(_ref) {
5953
5975
  resizeObserverRef.current.disconnect();
5954
5976
  resizeObserverRef.current = null;
5955
5977
  }
5978
+ if (intervalRef.current) {
5979
+ window.clearInterval(intervalRef.current);
5980
+ intervalRef.current = null;
5981
+ }
5956
5982
  };
5957
5983
  }, []);
5958
5984
  var toggleAccordion = function toggleAccordion() {