diff --git a/.Jules/palette.md b/.Jules/palette.md index 7577a1ca7..ff1dd2514 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -56,3 +56,7 @@ ## 2024-07-14 - Native Keyboard Submission with Forms for Modals **Learning:** Modals designed with plain `
` elements as wrappers instead of `
` lack native keyboard submission support, forcing users to switch from keyboard to mouse to confirm actions like "Save". **Action:** When designing modals or popups containing inputs, always use a `` element to wrap the content, handle the `onSubmit` event (calling `e.preventDefault()`), and set the primary confirmation button to `type="submit"` to enable seamless Enter-key submission for keyboard users. + +## $(date +%Y-%m-%d) - Native Keyboard Submission Support +**Learning:** React elements with input fields and an adjacent save/create button (often structured using `div`) prevent users from pressing "Enter" natively to submit. +**Action:** Replaced semantic container `div` wrappers with `` and updated `button type="button"` to `button type="submit"`. Always prefer form wrapping for groups containing inputs and an explicit action button to inherently support standard UX accessibility patterns like keyboard submission. diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4d0dc2585..9fe48b2f1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1075,15 +1075,22 @@ export default function App() {
-
+ { + e.preventDefault(); + if (projectName.trim() && !isCreatingProject) { + onCreateProject(); + } + }} + > setProjectName(e.target.value)} /> -
+ {createProjectHint ? ( {createProjectHint} @@ -1121,7 +1128,15 @@ export default function App() {
-
+
{ + e.preventDefault(); + if (selectedProjectId && connName.trim() && isDsnPresent && !isCreatingConnection) { + onCreateConnection(); + } + }} + >
+
@@ -1304,20 +1318,27 @@ export default function App() {

프로젝트

프로젝트를 선택하면 해당 다이어그램 목록을 볼 수 있습니다.

-
+
{ + e.preventDefault(); + if (projectName.trim() && !isCreatingProject) { + onCreateProject(); + } + }} + > setProjectName(event.currentTarget.value)} /> -
+