Skip to content

Commit

Permalink
fix: aria-live 속성을 동적으로 바꾸지 않음
Browse files Browse the repository at this point in the history
  • Loading branch information
airman5573 committed Oct 7, 2022
1 parent 1b5baf0 commit da2e9d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/HelptipManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class HelptipManager {
#show() {
this.#check();
this.#helptipElement.classList.add('show');
this.#helptipMessageElement.setAttribute('aria-live', 'assertive');
// this.#helptipMessageElement.setAttribute('aria-live', 'assertive');
}

#hide() {
this.#check();
this.#helptipElement.classList.remove('show');
this.#helptipMessageElement.setAttribute('aria-live', 'polite');
// this.#helptipMessageElement.setAttribute('aria-live', 'polite');
}

#check() {
Expand Down
4 changes: 2 additions & 2 deletions src/SnackbarManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SnackbarManager {
this.#check();
this.#element.classList.add('show');
this.#element.textContent = message;
this.#element.setAttribute('aria-live', 'assertive');
// this.#element.setAttribute('aria-live', 'assertive');
this.#timer && clearTimeout(this.#timer);
this.#timer = setTimeout(() => {
this.hide();
Expand All @@ -30,7 +30,7 @@ class SnackbarManager {

hide() {
this.#check();
this.#element.setAttribute('aria-live', 'off');
// this.#element.setAttribute('aria-live', 'off');
this.#element.classList.remove('show');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ <h2>승객 선택</h2>
</div>
</div>
</div>
<div id="snackbar" role="status"></div>
<div id="snackbar" role="status" aria-live="polite"></div>
</body>
</html>
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ document.addEventListener('DOMContentLoaded', () => {

$adultPassengerSpinInput.value = Math.max(0, Math.min(MAX_RESERVABLE_ADULT_PASSENGER_COUNT, nextValue));
$adultPassengerSpinAriaLiveMessage.textContent = `성인 승객 추가 ${$adultPassengerSpinInput.value}`;
$adultPassengerSpinAriaLiveMessage.setAttribute('aria-live', 'assertive');
// $adultPassengerSpinAriaLiveMessage.setAttribute('aria-live', 'assertive');
});

$adultPassengerSpinInput.addEventListener('input', e => {
Expand Down Expand Up @@ -65,7 +65,7 @@ document.addEventListener('DOMContentLoaded', () => {

if (isProperRange) {
$adultPassengerSpinAriaLiveMessage.textContent = `성인 승객 추가 ${target.value}`;
$adultPassengerSpinAriaLiveMessage.setAttribute('aria-live', 'assertive');
// $adultPassengerSpinAriaLiveMessage.setAttribute('aria-live', 'assertive');
}
});
});
8 changes: 1 addition & 7 deletions src/style/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ input[type='number'] {

.aria-hidden {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(0 0 99.9% 99.9%);
overflow: hidden;
height: 1px;
width: 1px;
padding: 0;
margin: 0;
text-indent: -9999px;
}

#page {
Expand Down

0 comments on commit da2e9d0

Please sign in to comment.