reachat 1.4.0 → 1.4.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.
@@ -70,9 +70,14 @@
70
70
  stopIcon = /* @__PURE__ */ jsxRuntime.jsx(SvgStop, {}),
71
71
  attachIcon
72
72
  }, ref) => {
73
- const { theme, isLoading, disabled, sendMessage, stopMessage, fileUpload } = React.useContext(ChatContext);
73
+ const { theme, isLoading, disabled, sendMessage, stopMessage, fileUpload, activeSessionId } = React.useContext(ChatContext);
74
74
  const [message, setMessage] = React.useState("");
75
75
  const inputRef = React.useRef(null);
76
+ React.useEffect(() => {
77
+ if (inputRef.current) {
78
+ inputRef.current.focus();
79
+ }
80
+ }, [activeSessionId, inputRef]);
76
81
  React.useImperativeHandle(ref, () => ({
77
82
  focus: () => {
78
83
  var _a;
@@ -102,7 +107,7 @@
102
107
  /* @__PURE__ */ jsxRuntime.jsx(
103
108
  reablocks.Textarea,
104
109
  {
105
- inputRef,
110
+ ref: inputRef,
106
111
  containerClassName: reablocks.cn(theme.input.input),
107
112
  minRows: 1,
108
113
  autoFocus: true,