Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@react-aria/dnd/src/useAutoScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function useAutoScroll(ref: RefObject<Element>) {
return {
move(x, y) {
// Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷‍♂️).
// https://bugs.webkit.org/show_bug.cgi?id=222636
if (!isWebKit() || isIOS() || !scrollableRef.current) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/dnd/stories/Reorderable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export function ReorderableGridExample(props) {
}

if (e.target.dropPosition === 'before') {
list.moveBefore(e.target.key, ...items);
list.moveBefore(e.target.key, items);
} else {
list.moveAfter(e.target.key, ...items);
list.moveAfter(e.target.key, items);
}
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/@react-aria/interactions/src/usePress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export function usePress(props: PressHookProps): PressResult {
}

// iOS safari fires pointer events from VoiceOver (but only when outside an iframe...)
// https://bugs.webkit.org/show_bug.cgi?id=222627
state.pointerType = isVirtualPointerEvent(e.nativeEvent) ? 'virtual' : e.pointerType;

e.stopPropagation();
Expand Down
1 change: 1 addition & 0 deletions packages/@react-aria/overlays/src/ariaHideOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function ariaHideOutside(targets: HTMLElement[], root = document.body) {
}

// VoiceOver on iOS has issues hiding elements with role="row". Hide the cells inside instead.
// https://bugs.webkit.org/show_bug.cgi?id=222623
if (node instanceof HTMLElement && node.getAttribute('role') === 'row') {
return NodeFilter.FILTER_SKIP;
}
Expand Down
1 change: 0 additions & 1 deletion packages/@react-spectrum/tabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@adobe/react-spectrum": "^3.8.0",
"@babel/runtime": "^7.6.2",
"@react-aria/focus": "^3.2.2",
"@react-aria/i18n": "^3.3.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/@react-stately/data/src/useListData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ export interface ListData<T> {
* @param key - The key of the item to move the items before.
* @param keys - The keys of the items to move.
*/
moveBefore(key: Key, ...keys: Key[]): void,
moveBefore(key: Key, keys: Key[]): void,

/**
* Moves one or more items after a given key.
* @param key - The key of the item to move the items after.
* @param keys - The keys of the items to move.
*/
moveAfter(key: Key, ...keys: Key[]): void,
moveAfter(key: Key, keys: Key[]): void,

/**
* Updates an item in the list.
Expand Down Expand Up @@ -258,7 +258,7 @@ export function createListActions<T>(opts: ListOptions<T>, dispatch: (updater: (
};
});
},
moveBefore(key: Key, ...keys: Key[]) {
moveBefore(key: Key, keys: Key[]) {
dispatch(state => {
let toIndex = state.items.findIndex(item => getKey(item) === key);
if (toIndex === -1) {
Expand All @@ -270,7 +270,7 @@ export function createListActions<T>(opts: ListOptions<T>, dispatch: (updater: (
return move(state, indices, toIndex);
});
},
moveAfter(key: Key, ...keys: Key[]) {
moveAfter(key: Key, keys: Key[]) {
dispatch(state => {
let toIndex = state.items.findIndex(item => getKey(item) === key);
if (toIndex === -1) {
Expand Down
28 changes: 14 additions & 14 deletions packages/@react-stately/data/test/useListData.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Three', 'One');
result.current.moveBefore('Three', ['One']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -326,7 +326,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Sam', 'Julia');
result.current.moveBefore('Sam', ['Julia']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -343,7 +343,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Five', 'Two', 'Three');
result.current.moveBefore('Five', ['Two', 'Three']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -363,7 +363,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Two', 'Five', 'Six');
result.current.moveBefore('Two', ['Five', 'Six']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -383,7 +383,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Five', 'One', 'Three');
result.current.moveBefore('Five', ['One', 'Three']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -403,7 +403,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Two', 'Four', 'Six');
result.current.moveBefore('Two', ['Four', 'Six']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -423,7 +423,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveBefore('Three', 'One', 'Five');
result.current.moveBefore('Three', ['One', 'Five']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -445,7 +445,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Three', 'One');
result.current.moveAfter('Three', ['One']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -465,7 +465,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Three', 'Five');
result.current.moveAfter('Three', ['Five']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -485,7 +485,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Five', 'Two', 'Three');
result.current.moveAfter('Five', ['Two', 'Three']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -505,7 +505,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Two', 'Five', 'Six');
result.current.moveAfter('Two', ['Five', 'Six']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -525,7 +525,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Five', 'One', 'Three');
result.current.moveAfter('Five', ['One', 'Three']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -545,7 +545,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Two', 'Four', 'Six');
result.current.moveAfter('Two', ['Four', 'Six']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand All @@ -565,7 +565,7 @@ describe('useListData', function () {
let initialResult = result.current;

act(() => {
result.current.moveAfter('Three', 'One', 'Five');
result.current.moveAfter('Three', ['One', 'Five']);
});

expect(result.current.items).not.toBe(initialResult.items);
Expand Down
1 change: 1 addition & 0 deletions packages/@react-stately/selection/src/SelectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class SelectionManager implements MultipleSelectionManager {
return this.state.focusedKey;
}

/** Whether the first or last child of the focused key should receive focus. */
get childFocusStrategy(): FocusStrategy {
return this.state.childFocusStrategy;
}
Expand Down