웹 접근성 조치
This commit is contained in:
@@ -103,7 +103,8 @@ export function LNB({
|
||||
control.tabIndex >= 0 &&
|
||||
!control.hasAttribute("disabled") &&
|
||||
control.getAttribute("aria-disabled") !== "true" &&
|
||||
!control.closest('[hidden], [aria-hidden="true"]'),
|
||||
!control.closest('[hidden], [aria-hidden="true"]') &&
|
||||
control.getClientRects().length > 0,
|
||||
);
|
||||
const currentIndex = menuControls.findIndex(
|
||||
(control) =>
|
||||
@@ -120,6 +121,19 @@ export function LNB({
|
||||
event.preventDefault();
|
||||
nextControl.focus();
|
||||
nextControl.scrollIntoView({ block: "nearest" });
|
||||
} else if (
|
||||
isMobile &&
|
||||
!event.shiftKey &&
|
||||
currentIndex === menuControls.length - 1
|
||||
) {
|
||||
const closeButton = event.currentTarget
|
||||
.closest<HTMLElement>('[data-sidebar="sidebar"]')
|
||||
?.querySelector<HTMLElement>(":scope > button");
|
||||
|
||||
if (closeButton) {
|
||||
event.preventDefault();
|
||||
closeButton.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user