@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.
package/dist/index.js CHANGED
@@ -4187,6 +4187,8 @@ var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent) {
4187
4187
  setShowTooltip = _useState[1];
4188
4188
 
4189
4189
  var shouldTruncate = typeof tooltipContent === 'string';
4190
+ var labelElement = document.getElementById(labelId);
4191
+ var isHidden = labelElement && labelElement.offsetParent === null;
4190
4192
  var handleApplyTooltip = React.useCallback(function () {
4191
4193
  if (!shouldTruncate) {
4192
4194
  return;
@@ -4199,8 +4201,11 @@ var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent) {
4199
4201
  }
4200
4202
 
4201
4203
  var shouldShowTooltip = isEllipsisActive(labelElement);
4202
- setShowTooltip(shouldShowTooltip);
4203
- }, [shouldTruncate]);
4204
+
4205
+ if (showTooltip !== shouldShowTooltip) {
4206
+ setShowTooltip(shouldShowTooltip);
4207
+ }
4208
+ }, [shouldTruncate, isHidden]);
4204
4209
  React.useEffect(function () {
4205
4210
  var onWindowResize = lodashEs.debounce(handleApplyTooltip, 300);
4206
4211
  window.addEventListener('resize', onWindowResize);
@@ -4300,6 +4305,7 @@ var AffixContainer = function AffixContainer(_ref) {
4300
4305
  var container = React.useRef(null);
4301
4306
  var prefixElement = React.useRef(null);
4302
4307
  var suffixElement = React.useRef(null);
4308
+ var isHidden = container.current && container.current.offsetParent === null;
4303
4309
  React.useLayoutEffect(function () {
4304
4310
  if (container.current) {
4305
4311
  var input = container.current.querySelector('input, [class$=control] > div');
@@ -4318,7 +4324,7 @@ var AffixContainer = function AffixContainer(_ref) {
4318
4324
  }
4319
4325
  }
4320
4326
  }
4321
- }, [prefix, suffix]);
4327
+ }, [prefix, suffix, isHidden]);
4322
4328
  var hasPrefix = !!prefix;
4323
4329
  var hasSuffix = !!suffix;
4324
4330