Skip to content

Commit b15da10

Browse files
committed
add cmd+enter
1 parent faaa604 commit b15da10

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/components/HogMap/PlaceDetail.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,21 @@ export default function PlaceDetail({ place, onClose }: PlaceDetailProps) {
201201
</div>
202202

203203
<div className="mb-3">
204-
<label className="text-[13px] text-secondary mb-1 block">Your review</label>
204+
<label className="text-[13px] text-secondary mb-1 block">
205+
Your review
206+
<span className="text-[11px] text-muted ml-2">(⌘+Enter to submit)</span>
207+
</label>
205208
<textarea
206209
value={reviewText}
207210
onChange={(e) => setReviewText(e.target.value)}
211+
onKeyDown={(e) => {
212+
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
213+
e.preventDefault()
214+
if (reviewText.trim() && !submitting) {
215+
handleSubmitReview()
216+
}
217+
}
218+
}}
208219
placeholder="Share your thoughts..."
209220
className="w-full border border-primary rounded px-3 py-2 bg-primary text-primary text-sm resize-none"
210221
rows={4}

0 commit comments

Comments
 (0)