Skip to content

Commit 51cd81a

Browse files
committed
fix(ui-select): prevent scrolling when last item is hovered in Chrome
INSTUI-4361
1 parent 34dfbce commit 51cd81a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/ui-select/src/Select/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
133133
@testable()
134134
class Select extends Component<SelectProps> {
135135
static readonly componentId = 'Select'
136+
private readonly SCROLL_TOLERANCE = 0.5
136137

137138
static allowedProps = allowedProps
138139
static propTypes = propTypes
@@ -527,7 +528,10 @@ class Select extends Component<SelectProps> {
527528
display: 'block',
528529
overflowY: 'auto',
529530
maxHeight:
530-
optionsMaxHeight || this._optionHeight * visibleOptionsCount!,
531+
optionsMaxHeight ||
532+
this._optionHeight * visibleOptionsCount! -
533+
// in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
534+
(utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
531535
maxWidth: optionsMaxWidth || this.width,
532536
background: 'primary',
533537
elementRef: (node: Element | null) => (this._listView = node),

0 commit comments

Comments
 (0)