Skip to content

Commit

Permalink
feat: Add onKeyDown event listener to text area in Upload page
Browse files Browse the repository at this point in the history
  • Loading branch information
bramses committed Aug 28, 2024
1 parent 4ba7bd3 commit 94bc9e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/[locale]/(auth)/dashboard/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ const Upload = () => {
className="mt-4 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder:text-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
placeholder="Your message..."
value={textAreaValue}
onKeyDown={(e) => {
if (e.key === 'Enter' && e.metaKey) {
add(textAreaValue);
}
}}
onChange={(e) => setTextAreaValue(e.target.value)}
/>
{/* input fields and add buttons for key, values that can be optionally added to metadata, put title and author in by default */}
Expand Down

0 comments on commit 94bc9e3

Please sign in to comment.