@7shifts/sous-chef 2.15.7 → 2.15.8

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.
@@ -4182,6 +4182,8 @@ var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent) {
4182
4182
  setShowTooltip = _useState[1];
4183
4183
 
4184
4184
  var shouldTruncate = typeof tooltipContent === 'string';
4185
+ var labelElement = document.getElementById(labelId);
4186
+ var isHidden = labelElement && labelElement.offsetParent === null;
4185
4187
  var handleApplyTooltip = useCallback(function () {
4186
4188
  if (!shouldTruncate) {
4187
4189
  return;
@@ -4194,8 +4196,11 @@ var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent) {
4194
4196
  }
4195
4197
 
4196
4198
  var shouldShowTooltip = isEllipsisActive(labelElement);
4197
- setShowTooltip(shouldShowTooltip);
4198
- }, [shouldTruncate]);
4199
+
4200
+ if (showTooltip !== shouldShowTooltip) {
4201
+ setShowTooltip(shouldShowTooltip);
4202
+ }
4203
+ }, [shouldTruncate, isHidden]);
4199
4204
  useEffect(function () {
4200
4205
  var onWindowResize = debounce(handleApplyTooltip, 300);
4201
4206
  window.addEventListener('resize', onWindowResize);
@@ -4295,6 +4300,7 @@ var AffixContainer = function AffixContainer(_ref) {
4295
4300
  var container = useRef(null);
4296
4301
  var prefixElement = useRef(null);
4297
4302
  var suffixElement = useRef(null);
4303
+ var isHidden = container.current && container.current.offsetParent === null;
4298
4304
  useLayoutEffect(function () {
4299
4305
  if (container.current) {
4300
4306
  var input = container.current.querySelector('input, [class$=control] > div');
@@ -4313,7 +4319,7 @@ var AffixContainer = function AffixContainer(_ref) {
4313
4319
  }
4314
4320
  }
4315
4321
  }
4316
- }, [prefix, suffix]);
4322
+ }, [prefix, suffix, isHidden]);
4317
4323
  var hasPrefix = !!prefix;
4318
4324
  var hasSuffix = !!suffix;
4319
4325