Skip to content

Commit

Permalink
refactor: Highlight the text in the message textarea on focus in Dash…
Browse files Browse the repository at this point in the history
…boardLayout component
  • Loading branch information
bramses committed Sep 10, 2024
1 parent 28e3465 commit 66d706c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/[locale]/(auth)/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export default function DashboardLayout(props: { children: React.ReactNode }) {
}

// focus on the textarea
const message = document.getElementById('message');
const message = document.getElementById('message') as HTMLTextAreaElement;
if (message) {
message.focus();
// highlight the text in the textarea
message.select();
}
};

Expand Down

0 comments on commit 66d706c

Please sign in to comment.