Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Add Enter key support for URL screenshot capture

Abi Rajab94cf77cdedd
diff --git a/design-docs/todo-list.md b/design-docs/todo-list.md
index 4b14317c..aff8fa1a 100644
--- a/design-docs/todo-list.md
+++ b/design-docs/todo-list.md
@@ -1,2 +1,2 @@
-1. enter should trigger generation in URL textbox
+1. ✓ enter should trigger generation in URL textbox
2. ✓ write some tests for the URL normalization
diff --git a/frontend/src/components/UrlInputSection.tsx b/frontend/src/components/UrlInputSection.tsx
index 18422d61..25ab5e5d 100644
--- a/frontend/src/components/UrlInputSection.tsx
+++ b/frontend/src/components/UrlInputSection.tsx
@@ -65,6 +65,11 @@ export function UrlInputSection({ doCreate, screenshotOneApiKey }: Props) {
placeholder="Enter URL"
onChange={(e) => setReferenceUrl(e.target.value)}
value={referenceUrl}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && !isLoading) {
+ takeScreenshot();
+ }
+ }}
/>
<Button
onClick={takeScreenshot}