Merge pull request #1612 from Jellepostma/fix/listboxhorizontalscrolling

Fix: Prevent default behavior while scrolling using arrow keys in a h…
This commit is contained in:
Joren Broekema 2022-03-08 09:14:21 +01:00 committed by GitHub
commit cd2bc1351f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/listbox': patch
---
Fix: Prevent default behavior while scrolling using arrow keys in a horizontal listbox

View file

@ -589,6 +589,7 @@ const ListboxMixinImplementation = superclass =>
}
break;
case 'ArrowLeft':
ev.preventDefault();
if (this.orientation === 'horizontal') {
this.activeIndex = this._getPreviousEnabledOption(this.activeIndex);
}
@ -600,6 +601,7 @@ const ListboxMixinImplementation = superclass =>
}
break;
case 'ArrowRight':
ev.preventDefault();
if (this.orientation === 'horizontal') {
this.activeIndex = this._getNextEnabledOption(this.activeIndex);
}