Skip to content

Commit 112df59

Browse files
committed
Merge branch 'select-scrollview' of https://github.com/adobe/react-spectrum into s2-combobox-picker-virtualizer
2 parents cb52f58 + ebba44e commit 112df59

File tree

17 files changed

+37
-14
lines changed

17 files changed

+37
-14
lines changed

packages/@react-spectrum/autocomplete/test/SearchAutocomplete.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ describe('SearchAutocomplete', function () {
143143
user = userEvent.setup({delay: null, pointerMap});
144144
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(() => 1000);
145145
jest.spyOn(window.HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(() => 1000);
146+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
146147
window.HTMLElement.prototype.scrollIntoView = jest.fn();
147148
simulateDesktop();
148149
jest.useFakeTimers();

packages/@react-spectrum/card/test/CardView.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ describe('CardView', function () {
144144
jest.useFakeTimers();
145145
});
146146

147+
beforeEach(() => {
148+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
149+
});
150+
147151
afterEach(() => {
148152
jest.clearAllMocks();
149153
act(() => jest.runAllTimers());

packages/@react-spectrum/color/src/ColorSlider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export const ColorSlider = React.forwardRef(function ColorSlider(props: Spectrum
9292
{
9393
'spectrum-ColorSlider-container--horizontal': !vertical,
9494
'spectrum-ColorSlider-container--vertical': vertical
95-
}
95+
},
96+
styleProps.className
9697
)}>
9798
{label &&
9899
<div className={classNames(styles, 'spectrum-ColorSlider-labelContainer')}>

packages/@react-spectrum/color/test/ColorPicker.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ describe('ColorPicker', function () {
2222

2323
beforeAll(() => {
2424
user = userEvent.setup({delay: null, pointerMap});
25+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
2526
jest.useFakeTimers();
2627
});
2728

29+
afterAll(function () {
30+
jest.restoreAllMocks();
31+
});
32+
2833
afterEach(() => {
2934
act(() => {jest.runAllTimers();});
3035
});

packages/@react-spectrum/combobox/test/ComboBox.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ describe('ComboBox', function () {
257257
});
258258

259259
beforeEach(() => {
260+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
260261
load = jest
261262
.fn()
262263
.mockImplementationOnce(getFilterItems)

packages/@react-spectrum/picker/test/Picker.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {User} from '@react-aria/test-utils';
3131
import userEvent from '@testing-library/user-event';
3232

3333
describe('Picker', function () {
34-
let offsetWidth, offsetHeight;
34+
let offsetWidth, offsetHeight, scrollHeight;
3535
let onSelectionChange = jest.fn();
3636
let testUtilUser = new User();
3737
let user;
@@ -40,13 +40,15 @@ describe('Picker', function () {
4040
user = userEvent.setup({delay: null, pointerMap});
4141
offsetWidth = jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(() => 1000);
4242
offsetHeight = jest.spyOn(window.HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(() => 1000);
43+
scrollHeight = jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
4344
simulateDesktop();
4445
jest.useFakeTimers();
4546
});
4647

4748
afterAll(function () {
4849
offsetWidth.mockReset();
4950
offsetHeight.mockReset();
51+
scrollHeight.mockReset();
5052
});
5153

5254
afterEach(() => {

packages/@react-spectrum/picker/test/TempUtilTest.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ describe('Picker/Select ', function () {
2727

2828
beforeAll(function () {
2929
user = userEvent.setup({delay: null, pointerMap});
30+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
3031
simulateDesktop();
3132
});
3233

34+
afterAll(function () {
35+
jest.restoreAllMocks();
36+
});
37+
3338
describe('with real timers', function () {
3439
beforeAll(function () {
3540
jest.useRealTimers();

packages/@react-spectrum/s2/src/Menu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ let keyboard = style<{size: 'S' | 'M' | 'L' | 'XL', isDisabled: boolean}>({
306306
isDisabled: 'GrayText'
307307
}
308308
},
309-
backgroundColor: 'gray-25',
310309
unicodeBidi: 'plaintext'
311310
});
312311

packages/@react-spectrum/s2/src/TableView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ export class S2TableLayout<T> extends TableLayout<T> {
194194

195195
protected buildCollection(): LayoutNode[] {
196196
let [header, body] = super.buildCollection();
197+
if (!header) {
198+
return [];
199+
}
197200
let {children, layoutInfo} = body;
198201
// TableLayout's buildCollection always sets the body width to the max width between the header width, but
199202
// we want the body to be sticky and only as wide as the table so it is always in view if loading/empty

packages/@react-spectrum/tabs/test/Tabs.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ describe('Tabs', function () {
6060
beforeEach(() => {
6161
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(() => 1000);
6262
jest.spyOn(window.HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(() => 1000);
63+
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 50);
6364
window.HTMLElement.prototype.scrollIntoView = jest.fn();
6465
});
6566

0 commit comments

Comments
 (0)