Skip to content

Commit

Permalink
Merge pull request #549 from hariraghav10/ui-update
Browse files Browse the repository at this point in the history
UI update - Added autofocus for user chat input
  • Loading branch information
dartpain authored Oct 10, 2023
2 parents fb66181 + e772dfa commit e91b30f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ export default function Conversation() {
scrollIntoView();
}, [queries.length, queries[queries.length - 1]]);

useEffect(() => {
const element = document.getElementById('inputbox') as HTMLInputElement;
if (element) {
element.focus();
}
}, []);

useEffect(() => {
const observerCallback: IntersectionObserverCallback = (entries) => {
entries.forEach((entry) => {
Expand Down Expand Up @@ -152,7 +159,9 @@ export default function Conversation() {
<div className="relative bottom-0 flex w-10/12 flex-col items-end self-center bg-white pt-3 md:fixed md:w-[65%]">
<div className="flex h-full w-full">
<div
id="inputbox"
ref={inputRef}
tabIndex={1}
placeholder="Type your message here..."
contentEditable
onPaste={handlePaste}
Expand Down

2 comments on commit e91b30f

@vercel
Copy link

@vercel vercel bot commented on e91b30f Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-gpt – ./frontend

docs-gpt-brown.vercel.app
docs-gpt-arc53.vercel.app
docs-gpt-git-main-arc53.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e91b30f Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextra-docsgpt – ./docs

nextra-docsgpt-git-main-arc53.vercel.app
nextra-docsgpt.vercel.app
nextra-docsgpt-arc53.vercel.app
docs.docsgpt.co.uk

Please sign in to comment.