Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit a41057a

Browse files
committed
fixed styles and scrolling in Edge
1 parent 04083aa commit a41057a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/components/Dropdown/Dropdown.tsx

+6-8
Original file line numberDiff line numberDiff line change
@@ -721,24 +721,22 @@ export default class Dropdown extends AutoControlledComponent<
721721
this.trySetState({ value: newValue, searchQuery: '' })
722722

723723
if (!search && !multiple) {
724-
this.setState({
725-
defaultHighlightedIndex: items.indexOf(item),
726-
})
724+
this.setState({ defaultHighlightedIndex: items.indexOf(item) })
727725
}
728726

729727
if (getA11ySelectionMessage && getA11ySelectionMessage.onAdd) {
730728
this.setA11yStatus(getA11ySelectionMessage.onAdd(item))
731729
}
732730

733-
if (search) {
731+
if (multiple) {
734732
setTimeout(
735733
() =>
736-
this.selectedItemsRef.current.scrollTo({
737-
top: this.selectedItemsRef.current.scrollHeight,
738-
}),
734+
(this.selectedItemsRef.current.scrollTop = this.selectedItemsRef.current.scrollHeight),
739735
0,
740736
)
741-
} else {
737+
}
738+
739+
if (!search) {
742740
this.buttonRef.current.focus()
743741
}
744742

src/themes/teams/components/Dropdown/dropdownStyles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const dropdownStyles: ComponentSlotStylesInput<DropdownProps & DropdownState, Dr
8888
justifyContent: 'center',
8989
alignItems: 'center',
9090
userSelect: 'none',
91-
right: 0,
91+
right: pxToRem(5),
9292
}),
9393
}
9494

src/themes/teams/components/Dropdown/dropdownVariables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default (siteVars): DropdownVariables => ({
3838
listItemBackgroundColor: siteVars.white,
3939
listItemBackgroundColorActive: siteVars.brand,
4040
listItemColorActive: siteVars.white,
41-
selectedItemsMaxHeight: pxToRem(80),
41+
selectedItemsMaxHeight: pxToRem(82),
4242
toggleIndicatorSize: pxToRem(32),
4343
width: pxToRem(356),
4444
})

0 commit comments

Comments
 (0)