diff --git a/package-lock.json b/package-lock.json index adf87bd4..94f46cc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@statisticsnorway/ssb-component-library", - "version": "2.2.3", + "version": "2.2.5", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index da4f28be..2a7f78c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@statisticsnorway/ssb-component-library", - "version": "2.2.4", + "version": "2.2.5", "description": "Component library for SSB (Statistics Norway)", "main": "lib/bundle.js", "scripts": { diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 001536e4..4924fa2b 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -48,12 +48,13 @@ const Table = forwardRef(({ className, caption, da } const handleKeyPress = (event: React.KeyboardEvent, direction: Direction) => { - if (event.key === 'Enter') { + if (event.key === 'Enter' || event.key === ' ') { + event.preventDefault() setIsActive((prev) => ({ ...prev, [direction]: true })) handleScroll(direction) setTimeout(() => { setIsActive((prev) => ({ ...prev, [direction]: false })) - }, 150) // Reset active state after a short delay + }, 150) } }