From 29c671c0f46387077ed8a9e402769a9132d38a3f Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 19 Jan 2023 14:22:29 -0500 Subject: [PATCH] fixes #1138 --- docs/resources/changelog.md | 1 + src/components/select/select.ts | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 7cb5861ba..b81510c46 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -20,6 +20,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti - Fixed a bug in `` that prevented placeholders from showing when `multiple` was used [#1109](https://github.com/shoelace-style/shoelace/issues/1109) - Fixed a bug in `` that caused tags to not be rounded when using the `pill` attribute [#1117](https://github.com/shoelace-style/shoelace/issues/1117) - Fixed a bug in `` where the `sl-change` and `sl-input` events didn't weren't emitted when removing tags [#1119](https://github.com/shoelace-style/shoelace/issues/1119) +- Fixed a bug in `` that caused the listbox to scroll to the first selected item when selecting multiple items [#1138](https://github.com/shoelace-style/shoelace/issues/1138) - Fixed a bug in `` that logged a console error when parsing swatches with whitespace - Fixed a bug in `` that caused selected colors to be wrong due to incorrect HSV calculations - Fixed a bug in `` that caused the checked button's right border to be incorrect [#1110](https://github.com/shoelace-style/shoelace/issues/1110) diff --git a/src/components/select/select.ts b/src/components/select/select.ts index d01eb2580..d993d3393 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -460,7 +460,6 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon option.current = true; option.tabIndex = 0; option.focus(); - scrollIntoView(option, this.listbox); } } @@ -475,9 +474,6 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon // Set the new selection if (newSelectedOptions.length) { newSelectedOptions.forEach(el => (el.selected = true)); - - // Scroll the first selected option into view - scrollIntoView(newSelectedOptions[0]!, this.listbox); } // Update selection, value, and display label