@opengeni/react 2.5.0-canary.1 → 2.5.0-canary.2

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.
@@ -2883,6 +2883,7 @@ import {
2883
2883
  useContext,
2884
2884
  useEffect as useEffect3,
2885
2885
  useId as useId2,
2886
+ useLayoutEffect,
2886
2887
  useMemo as useMemo4,
2887
2888
  useRef as useRef4,
2888
2889
  useState as useState4
@@ -3049,18 +3050,26 @@ function useChatComposerController({
3049
3050
  const mountedRef = useRef4(true);
3050
3051
  const deliveredValueRef = useRef4(delivery.value);
3051
3052
  const liveValueRef = useRef4(delivery.value);
3052
- if (delivery.value !== deliveredValueRef.current) {
3053
+ const [renderedValue, setRenderedValue] = useState4(delivery.value);
3054
+ const deliveryChanged = delivery.value !== deliveredValueRef.current;
3055
+ if (deliveryChanged) {
3053
3056
  deliveredValueRef.current = delivery.value;
3054
3057
  liveValueRef.current = delivery.value;
3055
3058
  }
3056
3059
  const setComposerValue = useCallback4(
3057
3060
  (next) => {
3058
3061
  liveValueRef.current = next;
3062
+ setRenderedValue(next);
3059
3063
  delivery.setValue(next);
3060
3064
  },
3061
3065
  [delivery.setValue]
3062
3066
  );
3063
- const visibleValue = liveValueRef.current;
3067
+ const visibleValue = deliveryChanged ? delivery.value : renderedValue;
3068
+ useLayoutEffect(() => {
3069
+ if (renderedValue !== liveValueRef.current) {
3070
+ setRenderedValue(liveValueRef.current);
3071
+ }
3072
+ }, [delivery.value, renderedValue]);
3064
3073
  useEffect3(() => {
3065
3074
  mountedRef.current = true;
3066
3075
  return () => {
@@ -4545,4 +4554,4 @@ export {
4545
4554
  Status,
4546
4555
  ComposerTranscriptionControl
4547
4556
  };
4548
- //# sourceMappingURL=chunk-KSDXER4X.js.map
4557
+ //# sourceMappingURL=chunk-ZUT5QSQB.js.map