Skip to content

Commit d9f9bcd

Browse files
committed
Implement feedback from accessibility expert
1 parent b727827 commit d9f9bcd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/PageLayout/PageLayout.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ const VerticalDivider: React.FC<React.PropsWithChildren<DividerProps & Draggable
278278

279279
function handleKeyDrag(event: KeyboardEvent) {
280280
let delta = 0
281-
// Hardcoded a delta for every key press to move the splitter. Should I perhaps expose this as a prop?
282-
if (event.key === 'ArrowLeft' && currentWidth > minWidth) {
281+
// https://github.com/github/accessibility/issues/5101#issuecomment-1822870655
282+
if ((event.key === 'ArrowLeft' || event.key === 'ArrowDown') && currentWidth > minWidth) {
283283
delta = -3
284-
} else if (event.key === 'ArrowRight' && currentWidth < maxWidth) {
284+
} else if ((event.key === 'ArrowRight' || event.key === 'ArrowUp') && currentWidth < maxWidth) {
285285
delta = 3
286286
} else {
287287
return
@@ -349,7 +349,6 @@ const VerticalDivider: React.FC<React.PropsWithChildren<DividerProps & Draggable
349349
aria-label="Draggable pane splitter"
350350
aria-valuemin={minWidth}
351351
aria-valuemax={maxWidth}
352-
aria-orientation="vertical"
353352
aria-valuenow={currentWidth}
354353
aria-valuetext={`Pane width ${currentWidth} pixels`}
355354
tabIndex={0}

0 commit comments

Comments
 (0)