@instructure/ui-select 10.20.2-snapshot-7 → 10.20.2-snapshot-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -2
- package/es/Select/index.js +4 -1
- package/lib/Select/index.js +4 -1
- package/package.json +22 -22
- package/src/Select/index.tsx +5 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Select/index.d.ts +1 -0
- package/types/Select/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [10.20.2-snapshot-
|
|
6
|
+
## [10.20.2-snapshot-8](https://github.com/instructure/instructure-ui/compare/v10.20.1...v10.20.2-snapshot-8) (2025-06-24)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui-select:** prevent scrolling when last item is hovered in Chrome ([51cd81a](https://github.com/instructure/instructure-ui/commit/51cd81a5360bbbc78d30e7e2489bb0c02b67a470))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
package/es/Select/index.js
CHANGED
|
@@ -79,6 +79,7 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
79
79
|
let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_Select = class Select extends Component {
|
|
80
80
|
constructor(...args) {
|
|
81
81
|
super(...args);
|
|
82
|
+
this.SCROLL_TOLERANCE = 0.5;
|
|
82
83
|
this.state = {
|
|
83
84
|
hasInputRef: false
|
|
84
85
|
};
|
|
@@ -391,7 +392,9 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
|
|
|
391
392
|
const viewProps = isShowingOptions ? {
|
|
392
393
|
display: 'block',
|
|
393
394
|
overflowY: 'auto',
|
|
394
|
-
maxHeight: optionsMaxHeight || this._optionHeight * visibleOptionsCount
|
|
395
|
+
maxHeight: optionsMaxHeight || this._optionHeight * visibleOptionsCount - (
|
|
396
|
+
// in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
|
|
397
|
+
utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
|
|
395
398
|
maxWidth: optionsMaxWidth || this.width,
|
|
396
399
|
background: 'primary',
|
|
397
400
|
elementRef: node => this._listView = node,
|
package/lib/Select/index.js
CHANGED
|
@@ -91,6 +91,7 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
91
91
|
let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_Select = class Select extends _react.Component {
|
|
92
92
|
constructor(...args) {
|
|
93
93
|
super(...args);
|
|
94
|
+
this.SCROLL_TOLERANCE = 0.5;
|
|
94
95
|
this.state = {
|
|
95
96
|
hasInputRef: false
|
|
96
97
|
};
|
|
@@ -403,7 +404,9 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
|
|
|
403
404
|
const viewProps = isShowingOptions ? {
|
|
404
405
|
display: 'block',
|
|
405
406
|
overflowY: 'auto',
|
|
406
|
-
maxHeight: optionsMaxHeight || this._optionHeight * visibleOptionsCount
|
|
407
|
+
maxHeight: optionsMaxHeight || this._optionHeight * visibleOptionsCount - (
|
|
408
|
+
// in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
|
|
409
|
+
utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
|
|
407
410
|
maxWidth: optionsMaxWidth || this.width,
|
|
408
411
|
background: 'primary',
|
|
409
412
|
elementRef: node => this._listView = node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-select",
|
|
3
|
-
"version": "10.20.2-snapshot-
|
|
3
|
+
"version": "10.20.2-snapshot-8",
|
|
4
4
|
"description": "A component for select and autocomplete behavior.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "10.20.2-snapshot-
|
|
27
|
-
"@instructure/ui-color-utils": "10.20.2-snapshot-
|
|
28
|
-
"@instructure/ui-scripts": "10.20.2-snapshot-
|
|
29
|
-
"@instructure/ui-test-utils": "10.20.2-snapshot-
|
|
30
|
-
"@instructure/ui-themes": "10.20.2-snapshot-
|
|
26
|
+
"@instructure/ui-babel-preset": "10.20.2-snapshot-8",
|
|
27
|
+
"@instructure/ui-color-utils": "10.20.2-snapshot-8",
|
|
28
|
+
"@instructure/ui-scripts": "10.20.2-snapshot-8",
|
|
29
|
+
"@instructure/ui-test-utils": "10.20.2-snapshot-8",
|
|
30
|
+
"@instructure/ui-themes": "10.20.2-snapshot-8",
|
|
31
31
|
"@testing-library/jest-dom": "^6.6.3",
|
|
32
32
|
"@testing-library/react": "^16.0.1",
|
|
33
33
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/runtime": "^7.27.6",
|
|
38
|
-
"@instructure/emotion": "10.20.2-snapshot-
|
|
39
|
-
"@instructure/shared-types": "10.20.2-snapshot-
|
|
40
|
-
"@instructure/ui-dom-utils": "10.20.2-snapshot-
|
|
41
|
-
"@instructure/ui-form-field": "10.20.2-snapshot-
|
|
42
|
-
"@instructure/ui-icons": "10.20.2-snapshot-
|
|
43
|
-
"@instructure/ui-options": "10.20.2-snapshot-
|
|
44
|
-
"@instructure/ui-popover": "10.20.2-snapshot-
|
|
45
|
-
"@instructure/ui-position": "10.20.2-snapshot-
|
|
46
|
-
"@instructure/ui-prop-types": "10.20.2-snapshot-
|
|
47
|
-
"@instructure/ui-react-utils": "10.20.2-snapshot-
|
|
48
|
-
"@instructure/ui-selectable": "10.20.2-snapshot-
|
|
49
|
-
"@instructure/ui-testable": "10.20.2-snapshot-
|
|
50
|
-
"@instructure/ui-text-input": "10.20.2-snapshot-
|
|
51
|
-
"@instructure/ui-utils": "10.20.2-snapshot-
|
|
52
|
-
"@instructure/ui-view": "10.20.2-snapshot-
|
|
53
|
-
"@instructure/uid": "10.20.2-snapshot-
|
|
38
|
+
"@instructure/emotion": "10.20.2-snapshot-8",
|
|
39
|
+
"@instructure/shared-types": "10.20.2-snapshot-8",
|
|
40
|
+
"@instructure/ui-dom-utils": "10.20.2-snapshot-8",
|
|
41
|
+
"@instructure/ui-form-field": "10.20.2-snapshot-8",
|
|
42
|
+
"@instructure/ui-icons": "10.20.2-snapshot-8",
|
|
43
|
+
"@instructure/ui-options": "10.20.2-snapshot-8",
|
|
44
|
+
"@instructure/ui-popover": "10.20.2-snapshot-8",
|
|
45
|
+
"@instructure/ui-position": "10.20.2-snapshot-8",
|
|
46
|
+
"@instructure/ui-prop-types": "10.20.2-snapshot-8",
|
|
47
|
+
"@instructure/ui-react-utils": "10.20.2-snapshot-8",
|
|
48
|
+
"@instructure/ui-selectable": "10.20.2-snapshot-8",
|
|
49
|
+
"@instructure/ui-testable": "10.20.2-snapshot-8",
|
|
50
|
+
"@instructure/ui-text-input": "10.20.2-snapshot-8",
|
|
51
|
+
"@instructure/ui-utils": "10.20.2-snapshot-8",
|
|
52
|
+
"@instructure/ui-view": "10.20.2-snapshot-8",
|
|
53
|
+
"@instructure/uid": "10.20.2-snapshot-8",
|
|
54
54
|
"prop-types": "^15.8.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
package/src/Select/index.tsx
CHANGED
|
@@ -133,6 +133,7 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
|
|
|
133
133
|
@testable()
|
|
134
134
|
class Select extends Component<SelectProps> {
|
|
135
135
|
static readonly componentId = 'Select'
|
|
136
|
+
private readonly SCROLL_TOLERANCE = 0.5
|
|
136
137
|
|
|
137
138
|
static allowedProps = allowedProps
|
|
138
139
|
static propTypes = propTypes
|
|
@@ -527,7 +528,10 @@ class Select extends Component<SelectProps> {
|
|
|
527
528
|
display: 'block',
|
|
528
529
|
overflowY: 'auto',
|
|
529
530
|
maxHeight:
|
|
530
|
-
optionsMaxHeight ||
|
|
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),
|
|
531
535
|
maxWidth: optionsMaxWidth || this.width,
|
|
532
536
|
background: 'primary',
|
|
533
537
|
elementRef: (node: Element | null) => (this._listView = node),
|