fix(forms): 필드 오류가 아닌 저장 실패 뒤 키보드 포커스를 실패 상태로 옮긴다 (1103/08-02)
문제 참조 폼 페이지는 저장 중과 결과 불명 동안 저장 버튼에 disabled를 준다. 포커스가 있던 버튼이 꺼지면 브라우저가 포커스를 body로 내려놓는다. 폼은 필드 오류일 때만 포커스를 옮겼으므로, 키보드로 저장했다가 결과 불명(500)이나 429를 받으면 세 엔진 모두 포커스가 body로 떨어졌다. 복구 버튼은 폼 위 feedback 자리에 있어 셸 머리말부터 다시 지나야 닿았다. 고른 방법 - useAppForm이 feedbackId를 내고, 필드 오류·성공이 아닌 결과(결과 불명, 재인증, 권한 없음, 다시 시도, 사용 불가, 충돌)로 끝나면 렌더 뒤 그 요소에 포커스를 준다. FormPage(StandardPage)는 feedbackId를 받으면 feedback 자리를 id + tabIndex=-1인 포커스 대상으로 만든다. 페이지마다 포커스 코드를 복사하지 않게 하려고 hook과 템플릿에 두었다. - 참조 폼의 저장 버튼은 저장 중에 disabled 대신 Button의 pending(aria-busy)을 쓴다. 중복 제출은 지금처럼 폼(submitForm)과 onSubmit 가드가 막는다. 결과 불명 동안에는 여전히 꺼진다(08-01 범위). 그때는 위의 포커스 이동이 받는다. - 첫 행동 버튼 대신 feedback 자리 전체를 포커스한 이유: 실패 종류마다 버튼 구성이 다르고, Tab 한 번에 첫 복구 버튼에 닿는다. 매뉴얼 02 6절 FormPage에 feedbackId와 pending을 적었다. 위험·한계 - 스크린 리더가 포커스된 feedback 자리를 어떻게 읽는지는 확인하지 않았다. - 파생 폼 페이지는 feedbackId를 넘겨야 이 동작을 얻는다. - "deduplicates create" 테스트의 저장 중 단언을 disabled에서 aria-busy와 포커스 유지로 바꿨다. 한 번만 호출되는 단언은 그대로다. 검증 - RED: reference-page.test.tsx 새 2행(결과 불명, 429)이 수정 전 실패. e2e reference-save.spec.ts 새 2건이 수정 전 소스에서 chromium·firefox·webkit 6건 모두 실패(feedback 자리 focused 아님). - 수정 후 reference-save·reference-form e2e 3엔진 45건 통과(heavy lock, CHOKIDAR_USEPOLLING=1). tests/component·tests/features 60 files / 368 tests 통과. check:types, eslint, check:design-system, check:i18n, verify:documentation 통과. Refs: docs/reviews/2026-11-03-maturity-review/08-presentation.md 08-02
This commit is contained in:
@@ -68,6 +68,7 @@ export default function ReferenceResourceFormPage() {
|
||||
}}
|
||||
>
|
||||
<FormPage
|
||||
feedbackId={form.feedbackId}
|
||||
breadcrumb={
|
||||
<button
|
||||
className="ui-button ui-button--ghost"
|
||||
@@ -117,13 +118,16 @@ export default function ReferenceResourceFormPage() {
|
||||
>
|
||||
{message("reference.form.cancel")}
|
||||
</Button>
|
||||
{/* 1103/08-02. Busy, not disabled, while saving: a disabled
|
||||
button drops keyboard focus. The form refuses a second
|
||||
submit itself. */}
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={form.pending || mutationBlocked}
|
||||
pending={form.pending}
|
||||
pendingLabel={message("reference.form.saving")}
|
||||
disabled={mutationEffectUnknown}
|
||||
>
|
||||
{form.pending
|
||||
? message("reference.form.saving")
|
||||
: message("reference.form.save")}
|
||||
{message("reference.form.save")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
Reference in New Issue
Block a user