@royaloperahouse/chord 1.12.4-d-chord-development → 1.12.4-e-chord-development

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.
@@ -4075,11 +4075,6 @@ var Footer = function Footer(_ref) {
4075
4075
  }, additionalInfo)))));
4076
4076
  };
4077
4077
 
4078
- var IOSPlatforms = ['iPhone', 'iPad'];
4079
- var isIOSDevice = function isIOSDevice() {
4080
- return IOSPlatforms.includes(navigator.platform);
4081
- };
4082
-
4083
4078
  var _templateObject$x, _templateObject2$i, _templateObject3$b, _templateObject4$6, _templateObject5$4, _templateObject6$4;
4084
4079
  var LIST_ITEM_GAP = 32;
4085
4080
  var AnchorTabbarWrapper = /*#__PURE__*/styled__default.div(_templateObject$x || (_templateObject$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: sticky;\n width: 100%;\n top: 0;\n background-color: var(--base-color-white);\n z-index: ", ";\n"])), zIndexes.anchor);
@@ -4108,7 +4103,7 @@ var AnchorTabBar = function AnchorTabBar(_ref) {
4108
4103
  var tabs = _ref.tabs,
4109
4104
  onTabClick = _ref.onTabClick,
4110
4105
  activeTab = _ref.activeTab,
4111
- topOffsetForIOS = _ref.topOffsetForIOS;
4106
+ absolutePositionParams = _ref.absolutePositionParams;
4112
4107
  var tabListRef = React.useRef(null);
4113
4108
  var wrapperRef = React.useRef(null);
4114
4109
 
@@ -4169,17 +4164,20 @@ var AnchorTabBar = function AnchorTabBar(_ref) {
4169
4164
  };
4170
4165
 
4171
4166
  var handleScrollOnIOS = function handleScrollOnIOS() {
4172
- var topOffset = topOffsetForIOS;
4167
+ var _absolutePositionPara = absolutePositionParams.navigationHeight,
4168
+ navigationHeight = _absolutePositionPara === void 0 ? 0 : _absolutePositionPara,
4169
+ _absolutePositionPara2 = absolutePositionParams.topOffset,
4170
+ topOffset = _absolutePositionPara2 === void 0 ? 0 : _absolutePositionPara2;
4173
4171
 
4174
- if (wrapperRef.current && window.pageYOffset > topOffset) {
4172
+ if (wrapperRef.current && window.pageYOffset > topOffset + navigationHeight) {
4175
4173
  changeWrapperVisibilityOnOIS();
4176
- } else if (wrapperRef.current && window.pageYOffset < topOffset) {
4177
- changeWrapperVisibilityOnOIS(true, 0);
4174
+ } else if (wrapperRef.current && window.pageYOffset < topOffset + navigationHeight) {
4175
+ changeWrapperVisibilityOnOIS(true, topOffset);
4178
4176
  }
4179
4177
 
4180
4178
  if (timer !== null) clearTimeout(timer);
4181
4179
  timer = setTimeout(function () {
4182
- if (window.pageYOffset > topOffset && wrapperRef.current) {
4180
+ if (window.pageYOffset > topOffset + navigationHeight && wrapperRef.current) {
4183
4181
  changeWrapperVisibilityOnOIS(true, window.pageYOffset - topOffset);
4184
4182
  }
4185
4183
  }, 300);
@@ -4188,7 +4186,7 @@ var AnchorTabBar = function AnchorTabBar(_ref) {
4188
4186
 
4189
4187
 
4190
4188
  React.useEffect(function () {
4191
- if (topOffsetForIOS && isIOSDevice()) {
4189
+ if (absolutePositionParams) {
4192
4190
  document.addEventListener('scroll', handleScrollOnIOS);
4193
4191
  return function () {
4194
4192
  document.removeEventListener('scroll', handleScrollOnIOS);