ShipBit / slickgpt

SlickGPT is a light-weight "use-your-own-API-key" web client for the OpenAI API written in Svelte. It offers GPT-4 integration, a userless share feature and other superpowers.
https://slickgpt.vercel.app
MIT License
467 stars 95 forks source link

Prevent empty or whitespace-only submissions with `Enter` key in textarea #113

Closed Anajrim01 closed 2 months ago

Anajrim01 commented 2 months ago

Issue Description

When pressing the Enter key in an empty or whitespace-only textarea, the form submits. This behavior needs to be modified so that pressing Enter in this state creates a new line instead.

Expected Behavior

Steps to Reproduce

  1. Focus on the textarea.
  2. Press the Enter key when the textarea is empty or only contains whitespace.

Screenshots

image or image