diff --git a/src/hooks/useAccessibility.ts b/src/hooks/useAccessibility.ts index b60b27bf..9e3bc77a 100644 --- a/src/hooks/useAccessibility.ts +++ b/src/hooks/useAccessibility.ts @@ -263,8 +263,11 @@ export default function useAccessibility( return; } - // Arrow prevent default to avoid page scroll - if (ArrowKeys.includes(which) || [HOME, END].includes(which)) { + // Arrow prevent default to avoid page scroll, not apply for input and textarea + if ( + (ArrowKeys.includes(which) || [HOME, END].includes(which)) && + !['INPUT', 'TEXTAREA'].includes((e.target as Element).nodeName) + ) { e.preventDefault(); } diff --git a/tests/Menu.spec.js b/tests/Menu.spec.js index a9a803f1..6da2e5c6 100644 --- a/tests/Menu.spec.js +++ b/tests/Menu.spec.js @@ -435,6 +435,37 @@ describe('Menu', () => { expect(wrapper.isActive(1)).toBeTruthy(); }); + it('input and textarea cursor can be moved by arrow', () => { + const wrapper = mount( + + + + + +