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:
commit
cd2bc1351f
2 changed files with 7 additions and 0 deletions
5
.changeset/tasty-socks-hammer.md
Normal file
5
.changeset/tasty-socks-hammer.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@lion/listbox': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix: Prevent default behavior while scrolling using arrow keys in a horizontal listbox
|
||||||
|
|
@ -589,6 +589,7 @@ const ListboxMixinImplementation = superclass =>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
|
ev.preventDefault();
|
||||||
if (this.orientation === 'horizontal') {
|
if (this.orientation === 'horizontal') {
|
||||||
this.activeIndex = this._getPreviousEnabledOption(this.activeIndex);
|
this.activeIndex = this._getPreviousEnabledOption(this.activeIndex);
|
||||||
}
|
}
|
||||||
|
|
@ -600,6 +601,7 @@ const ListboxMixinImplementation = superclass =>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ArrowRight':
|
case 'ArrowRight':
|
||||||
|
ev.preventDefault();
|
||||||
if (this.orientation === 'horizontal') {
|
if (this.orientation === 'horizontal') {
|
||||||
this.activeIndex = this._getNextEnabledOption(this.activeIndex);
|
this.activeIndex = this._getNextEnabledOption(this.activeIndex);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue