add placeholder to input
This commit is contained in:
parent
b8f7ce6ad7
commit
16b38f4e98
3 changed files with 7 additions and 5 deletions
|
@ -71,7 +71,7 @@ function conversationUI(id: string) {
|
|||
|
||||
const form = (
|
||||
<form>
|
||||
<input type="text" required />
|
||||
<input type="text" placeholder="Enter a prompt…" required />
|
||||
</form>
|
||||
);
|
||||
const input = form.querySelector("input")!;
|
||||
|
|
6
client/web/dist/main.js
vendored
6
client/web/dist/main.js
vendored
|
@ -72,7 +72,9 @@ function conversationUI(id) {
|
|||
if (typeof event.data !== "string") return;
|
||||
const message = JSON.parse(event.data);
|
||||
const scrolledToBottom = chatlog.scrollTop + 16 >= chatlog.scrollHeight - chatlog.clientHeight;
|
||||
if ("u" in message) {
|
||||
if ("i" in message) {
|
||||
window.history.replaceState(null, "", "#" + message.i);
|
||||
} else if ("u" in message) {
|
||||
chatlog.append(/* @__PURE__ */ jsx("article", { className: "user", children: message.u }));
|
||||
} else if ("f" in message) {
|
||||
chatlog.append(/* @__PURE__ */ jsx("article", { className: "assistant", children: message.f }));
|
||||
|
@ -88,7 +90,7 @@ function conversationUI(id) {
|
|||
}
|
||||
if (scrolledToBottom) chatlog.scrollTop = chatlog.scrollHeight - chatlog.clientHeight;
|
||||
});
|
||||
const form = /* @__PURE__ */ jsx("form", { children: /* @__PURE__ */ jsx("input", { type: "text", required: true }) });
|
||||
const form = /* @__PURE__ */ jsx("form", { children: /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Enter a prompt\u2026", required: true }) });
|
||||
const input = form.querySelector("input");
|
||||
form.addEventListener("submit", (e) => {
|
||||
e.preventDefault();
|
||||
|
|
4
client/web/dist/main.js.map
vendored
4
client/web/dist/main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue