@doist/reactist 21.0.0 → 21.0.1

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.
@@ -482,7 +482,7 @@ function Tooltip({
482
482
  });
483
483
  const child = React.Children.only(children);
484
484
 
485
- if (!content || !child) {
485
+ if (!child) {
486
486
  return child;
487
487
  }
488
488
 
@@ -539,7 +539,7 @@ function Tooltip({
539
539
  onFocus: handleFocus,
540
540
  onBlur: handleBlur
541
541
  }));
542
- }), state.open ? /*#__PURE__*/React.createElement(Box, {
542
+ }), state.open && content ? /*#__PURE__*/React.createElement(Box, {
543
543
  as: tooltip.Tooltip,
544
544
  state: state,
545
545
  className: [modules_95f1407a.tooltip, exceptionallySetClassName],
@@ -2071,14 +2071,24 @@ const TextArea = /*#__PURE__*/React.forwardRef(function TextArea(_ref, ref) {
2071
2071
  React.useEffect(function setupAutoExpand() {
2072
2072
  const containerElement = containerRef.current;
2073
2073
 
2074
- function handleInput(event) {
2074
+ function handleAutoExpand(value) {
2075
2075
  if (containerElement) {
2076
- containerElement.dataset.replicatedValue = event.currentTarget.value;
2076
+ containerElement.dataset.replicatedValue = value;
2077
2077
  }
2078
2078
  }
2079
2079
 
2080
+ function handleInput(event) {
2081
+ handleAutoExpand(event.currentTarget.value);
2082
+ }
2083
+
2080
2084
  const textAreaElement = internalRef.current;
2081
- if (!textAreaElement || !autoExpand) return undefined;
2085
+
2086
+ if (!textAreaElement || !autoExpand) {
2087
+ return undefined;
2088
+ } // Apply change initially, in case the text area has a non-empty initial value
2089
+
2090
+
2091
+ handleAutoExpand(textAreaElement.value);
2082
2092
  textAreaElement.addEventListener('input', handleInput);
2083
2093
  return () => textAreaElement.removeEventListener('input', handleInput);
2084
2094
  }, [autoExpand]);