Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 25d5d07

Browse files
text area fix
1 parent d2fbc6b commit 25d5d07

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

‎packages/convostack-frontend-react/src/components/EmbeddableChat/UserInput.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ const UserInput: React.FC<UserInputProps> = ({
7575
}
7676
if (textarea !== null) textarea.style.height = "auto";
7777
};
78-
const textarea =
79-
typeof document !== "undefined" ? document.querySelector("textarea") : null;
78+
const textarea: HTMLTextAreaElement | null =
79+
typeof document !== "undefined"
80+
? document.querySelector("#userInput")
81+
: null;
8082
if (textarea) {
8183
textarea.addEventListener("input", function () {
8284
this.style.height = "auto";
@@ -99,6 +101,7 @@ const UserInput: React.FC<UserInputProps> = ({
99101
<div className="border-t-1">
100102
<div className="w-full min-h-14 bg-off-white flex items-center max-h-36 scrollbar-hidden py-4">
101103
<textarea
104+
id="userInput"
102105
placeholder="Send a message..."
103106
ref={textareaRef}
104107
value={inputValue}

‎packages/convostack-frontend-react/src/main.tsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ ReactDOM.render(
1818
/>
1919
<MyComponent text={"Dev's existing content"}></MyComponent>
2020
<div style={{ display: "flex", flexDirection: "row", width: "50%" }}>
21+
<div className="mb-4 w-full">
22+
<label htmlFor="name" className="block text-gray-700 font-bold mb-2">
23+
Name:
24+
</label>
25+
<textarea
26+
id="name"
27+
rows={4}
28+
className="w-full border border-gray-300 p-2 rounded-md resize-none"
29+
/>
30+
</div>
2131
<ConvoStackEmbed
2232
embedId="tester"
2333
customStyling={{
@@ -26,6 +36,7 @@ ReactDOM.render(
2636
embedHeight: "500px",
2737
}}
2838
/>
39+
2940
{/* <div style={{ backgroundColor: "red", width: "800px" }} /> */}
3041
</div>
3142
</ConvoStackWrapper>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /