-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: [접근성/UX 개선] 저장 버튼에 aria-disabled 적용 및 HTML5 유효성 검사 팝업 방지 #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
seonghobae
wants to merge
4
commits into
develop
from
palette-ux-aria-disabled-submit-2604010338605964020
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
43e3338
🎨 Palette: [접근성/UX 개선] 저장 버튼에 aria-disabled 적용 및 HTML5 유효성 검사 팝업 방지
seonghobae a833989
test(a11y): require feedback from aria-disabled save activation
seonghobae 4c7d0c6
안녕하세요! AI 코딩 에이전트 Jules입니다. 요청하신 🎨 Palette: [접근성/UX 개선] 작업을 다음과 같이 완료…
seonghobae d5ae896
chore: re-trigger CI to resolve Noema 502 Bad Gateway flake
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -429,6 +429,11 @@ function bindTableEvents(renderDraftValidation, updateEditorDraftFromEvent) { | |
| return; | ||
| } | ||
| event.preventDefault(); | ||
| const saveButton = form.querySelector('button[type="submit"]'); | ||
| if (saveButton && saveButton.getAttribute('aria-disabled') === 'true') { | ||
| showToast('입력값을 올바르게 수정해야 저장할 수 있습니다.'); | ||
| return; | ||
| } | ||
| renderDraftValidation.flush(); | ||
| saveEditor(); | ||
| }); | ||
|
|
@@ -822,6 +827,12 @@ function renderEditorRow(anchorId) { | |
| saveButton.textContent = '저장'; | ||
| saveButton.title = '저장 (Enter)'; | ||
| saveButton.setAttribute('aria-keyshortcuts', 'Enter'); | ||
| saveButton.addEventListener('click', (event) => { | ||
| if (saveButton.getAttribute('aria-disabled') === 'true') { | ||
| event.preventDefault(); | ||
| event.target.closest('form').dispatchEvent(new Event('submit', { bubbles: true, cancelable: true })); | ||
| } | ||
| }); | ||
| const cancelButton = document.createElement('button'); | ||
| cancelButton.type = 'button'; | ||
| cancelButton.className = 'secondary-button'; | ||
|
|
@@ -1068,7 +1079,11 @@ function renderEditorValidation() { | |
|
|
||
| const saveButton = form.querySelector('button[type="submit"]'); | ||
| if (saveButton) { | ||
| saveButton.disabled = errors.length > 0; | ||
| if (errors.length > 0) { | ||
| saveButton.setAttribute('aria-disabled', 'true'); | ||
| } else { | ||
| saveButton.removeAttribute('aria-disabled'); | ||
|
Comment on lines
+1082
to
+1085
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| saveButton.title = errors.length > 0 ? '입력값을 올바르게 수정해야 저장할 수 있습니다.' : '저장 (Enter)'; | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { expect, test } from '@playwright/test'; | ||
|
|
||
| test('aria-disabled save remains focusable and explains why activation is blocked', async ({ page }) => { | ||
| await page.goto('./'); | ||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
|
|
||
| const saveButton = page.getByRole('button', { name: '저장', exact: true }); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| await saveButton.focus(); | ||
| await expect(saveButton).toBeFocused(); | ||
|
|
||
| await saveButton.click({ force: true }); | ||
|
|
||
| await expect(page.locator('.editor-panel')).toBeVisible(); | ||
| await expect(page.locator('#toast')).toHaveText('입력값을 올바르게 수정해야 저장할 수 있습니다.'); | ||
| await expect(page.locator('#toast')).toHaveAttribute('role', 'status'); | ||
| await expect(page.locator('#toast')).toHaveClass(/\bshow\b/); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.use({ | ||
| viewport: { width: 375, height: 812 }, | ||
| isMobile: true, | ||
| hasTouch: true, | ||
| }); | ||
|
|
||
| test('mobile layout renders without breaking and aria-disabled save remains focusable and explains why activation is blocked', async ({ page }) => { | ||
| await page.goto('./'); | ||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
|
|
||
| const saveButton = page.getByRole('button', { name: '저장', exact: true }); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| await saveButton.focus(); | ||
| await expect(saveButton).toBeFocused(); | ||
|
|
||
| await saveButton.click({ force: true }); | ||
|
|
||
| await expect(page.locator('.editor-panel')).toBeVisible(); | ||
| await expect(page.locator('#toast')).toHaveText('입력값을 올바르게 수정해야 저장할 수 있습니다.'); | ||
| await expect(page.locator('#toast')).toHaveAttribute('role', 'status'); | ||
| await expect(page.locator('#toast')).toHaveClass(/\bshow\b/); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Immediate corrections remain unsavable
After users correct an invalid field, the
clicklistener reads the old state for 150 ms. An immediate save is silently discarded.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.