Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual list support #1293

Merged
merged 319 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
319 commits
Select commit Hold shift + click to select a range
61e394d
removing force abort test
alexreardon May 23, 2019
7192311
wip
alexreardon May 23, 2019
fc1cae4
more tests
alexreardon May 23, 2019
152619e
generic sensor test framework
alexreardon May 23, 2019
2a721cc
adding more control tests
alexreardon May 24, 2019
d655238
moving into shared
alexreardon May 24, 2019
63146af
more control tests
alexreardon May 24, 2019
88ad978
new multi sensor story
alexreardon May 24, 2019
b13ae87
multiple contexts
alexreardon May 24, 2019
fd2fb8d
wip
alexreardon May 24, 2019
7cfc9b1
internal cleanup
alexreardon May 24, 2019
ee2c914
adding another newsletter
alexreardon May 26, 2019
ba725b4
disable default sensors
alexreardon May 27, 2019
371c000
adding basic programmatic guide
alexreardon May 27, 2019
ff4d891
fixing guide
alexreardon May 27, 2019
ae133f1
content editable tests
alexreardon May 28, 2019
40a6f9c
interactive element tests
alexreardon May 28, 2019
0e494cf
tests for interactive elements
alexreardon May 28, 2019
4860b71
nested drag handle test
alexreardon May 28, 2019
029fd92
fixing some examples
alexreardon May 28, 2019
56cbcd4
new media entry
alexreardon May 28, 2019
1564879
svg dragging test
alexreardon May 28, 2019
bddb7a7
shared tests for blocking drag start
alexreardon May 28, 2019
46410f6
moving control file around
alexreardon May 29, 2019
e799615
more sensor tests
alexreardon May 29, 2019
1a8f32c
onDragEnd tests
alexreardon May 29, 2019
a9e218e
mroe robust testing
alexreardon May 29, 2019
396b642
direction movement for handles
alexreardon May 29, 2019
e195202
more media
alexreardon May 29, 2019
ed885eb
tests for cancelling
alexreardon May 30, 2019
58d3f35
more tests. fixing unneeded layout effect shuffle for keyboad
alexreardon May 30, 2019
ce4b4db
setting up empty touch specs
alexreardon May 30, 2019
82fca8e
more tests
alexreardon May 31, 2019
3ecde86
more touch tests
alexreardon May 31, 2019
cafef4a
context menu touch tests
alexreardon May 31, 2019
b063920
a little extra unmount safety
alexreardon May 31, 2019
e553b50
adding missing fake timer setup
alexreardon May 31, 2019
ca9a227
removing old drag handle
alexreardon May 31, 2019
8f3716f
flush drop animation on scroll
alexreardon Jun 2, 2019
86220d1
correct auto scroll drop location
alexreardon Jun 3, 2019
765e369
comment for droppable
alexreardon Jun 3, 2019
518ce3f
new api shape for programmatic api
alexreardon Jun 3, 2019
b9ba9f2
updating programmatic docs
alexreardon Jun 3, 2019
c576815
guide wip
alexreardon Jun 3, 2019
bf986f1
wip
alexreardon Jun 3, 2019
b2e50c6
working on docs
alexreardon Jun 3, 2019
3691367
preventing double lifting
alexreardon Jun 3, 2019
fd202bb
removing logs
alexreardon Jun 3, 2019
009d60b
v12.0.0-alpha.1
alexreardon Jun 3, 2019
b60300d
updating docs
alexreardon Jun 3, 2019
58276b8
fixing language
alexreardon Jun 3, 2019
24fbffb
updating docs
alexreardon Jun 4, 2019
cda5b9b
bumping raf-schd
alexreardon Jun 4, 2019
e63cf5c
removing __unstable sensor prefix
alexreardon Jun 4, 2019
2c88dd1
initial
alexreardon Jun 4, 2019
8396478
no more default props
alexreardon Jun 4, 2019
7a2a8c3
lovely
alexreardon Jun 6, 2019
bbbe608
validating clone prop
alexreardon Jun 6, 2019
06d312b
better comment
alexreardon Jun 6, 2019
b60109c
Merge branch 'master' of github.com:atlassian/react-beautiful-dnd int…
alexreardon Jun 7, 2019
b266362
Merge branch 'master' of github.com:atlassian/react-beautiful-dnd int…
alexreardon Jun 7, 2019
75382cb
Merge branch 'master' of github.com:atlassian/react-beautiful-dnd int…
alexreardon Jun 10, 2019
a9cd4fd
initial
alexreardon Jun 11, 2019
452cf52
yum
alexreardon Jun 11, 2019
ba212cd
yummmm
alexreardon Jun 11, 2019
321b872
wip
alexreardon Jun 11, 2019
c12ab70
correct reorder logic
alexreardon Jun 11, 2019
91ad76e
love it
alexreardon Jun 11, 2019
48b2e5c
wip
alexreardon Jun 11, 2019
642dbf1
first take at combining
alexreardon Jun 11, 2019
a706863
wip
alexreardon Jun 12, 2019
de78b67
lift effects
alexreardon Jun 12, 2019
3b15fd7
wip
alexreardon Jun 12, 2019
48deef2
yes
alexreardon Jun 12, 2019
4a32898
wip
alexreardon Jun 12, 2019
ab2a57a
awesomeo
alexreardon Jun 12, 2019
e421cd4
refactoring connected draggable
alexreardon Jun 12, 2019
da75aae
virtual board story
alexreardon Jun 12, 2019
de9550a
nicer colours
alexreardon Jun 12, 2019
222b1fe
beautiful example
alexreardon Jun 13, 2019
5264b75
consolidating reorder impact
alexreardon Jun 13, 2019
93b2e09
sooo good
alexreardon Jun 13, 2019
76c78fc
consolidating logic
alexreardon Jun 13, 2019
c9e7cac
more cleanup
alexreardon Jun 13, 2019
c9f2fd4
recompute visiblity
alexreardon Jun 13, 2019
590db50
cleaner recompute
alexreardon Jun 13, 2019
0b0bb52
little state shape refactor
alexreardon Jun 14, 2019
b8bb490
rename
alexreardon Jun 14, 2019
a6047f5
speculative increase
alexreardon Jun 14, 2019
456a50f
moving cross axis
alexreardon Jun 14, 2019
cef66e0
cleaner comparision
alexreardon Jun 14, 2019
0bc6414
keyboard combine
alexreardon Jun 17, 2019
59a362a
combining yah no
alexreardon Jun 17, 2019
249c330
keyboard combining
alexreardon Jun 17, 2019
c6a05a9
removing old file
alexreardon Jun 17, 2019
22a624d
removing Array.from
alexreardon Jun 17, 2019
d28291c
v12.0.0-alpha.2
alexreardon Jun 18, 2019
5a7b08a
using fallback for .find
alexreardon Jun 18, 2019
7b2e87d
v12.0.0-alpha.3
alexreardon Jun 18, 2019
7d494f7
initial
alexreardon Jun 18, 2019
36898a9
fixing sensor marshal tests
alexreardon Jun 18, 2019
e25fcb5
allowing event pass through
alexreardon Jun 18, 2019
dd83db7
updating docs
alexreardon Jun 18, 2019
3f629ab
all drag handle tests are passing now
alexreardon Jun 19, 2019
f2a0cdc
new sensor api shape
alexreardon Jun 19, 2019
114df6b
cleaner options
alexreardon Jun 19, 2019
7d64d39
slight shape change
alexreardon Jun 19, 2019
27de01b
fixing incorrect scroll at draggable collection
alexreardon Jun 19, 2019
ffb95ba
adding TODO
alexreardon Jun 20, 2019
d4bf849
v12.0.0-alpha.4
alexreardon Jun 20, 2019
bea70aa
fixing a single test
alexreardon Jun 20, 2019
077613c
renaming
alexreardon Jun 20, 2019
97d92eb
removing old comments
alexreardon Jun 20, 2019
8267188
pulling out helpers
alexreardon Jun 20, 2019
9c042d9
fixing integration tests
alexreardon Jun 20, 2019
e7dac63
responders timing
alexreardon Jun 23, 2019
98db679
combine on start responder
alexreardon Jun 23, 2019
1ea3645
disable on start
alexreardon Jun 23, 2019
d104bdb
responders integration
alexreardon Jun 23, 2019
5e64e71
little check
alexreardon Jun 23, 2019
732952e
fixing keyboard test
alexreardon Jun 23, 2019
5495b61
more test cleanup
alexreardon Jun 23, 2019
12a1ce3
converting annoucer tests to react-testing-library
alexreardon Jun 23, 2019
3719276
wip test cleanup
alexreardon Jun 23, 2019
df1cb0a
adding test to validate directions
alexreardon Jun 25, 2019
8a2e982
more test work
alexreardon Jun 26, 2019
2cbcdd3
upgrading to flow 102 and everything else
alexreardon Jun 26, 2019
f947f82
fixing cypress defintion
alexreardon Jun 26, 2019
39c592b
fixing flow issue
alexreardon Jun 26, 2019
805617b
moving to new react testing library package
alexreardon Jun 26, 2019
d78b5c9
fixing typing
alexreardon Jun 26, 2019
d9dadea
fixing ios bug
alexreardon Jun 27, 2019
00a194e
v12.0.0-alpha.5
alexreardon Jun 27, 2019
aebc9ce
fixing build
alexreardon Jun 27, 2019
856fa38
v12.0.0-alpha.6
alexreardon Jun 27, 2019
9184c0e
adding deps array for webkit hack
alexreardon Jun 27, 2019
f762d8b
simplifying test for dev warnings
alexreardon Jun 27, 2019
2d557b3
renaming
alexreardon Jun 27, 2019
c080b7c
Replaced aria-roledescription with aria-labelledby
Jun 27, 2019
af2f6dc
converting tests
alexreardon Jun 27, 2019
0305949
Improved colour contrast and added lang attribute to the html element…
Jun 27, 2019
1d9df51
over home list tests
alexreardon Jun 27, 2019
c4af668
more test fixing
alexreardon Jun 27, 2019
4b9fa3e
im staring at the sun
alexreardon Jun 27, 2019
faba883
fix: ignore window scroll event if it has bubbled there
Jun 27, 2019
3c85eb7
Seancurtis/accessibility improvements (#1383)
alexreardon Jun 27, 2019
cdcd668
api cleanup
alexreardon Jun 27, 2019
040f1dd
Merge pull request #1384 from nathanpower/ie11-drag-scroll-fix
alexreardon Jun 27, 2019
557d1b9
updating snapshots
alexreardon Jun 27, 2019
ea9c2c2
cleaning up some docs
alexreardon Jun 27, 2019
4a6f3c8
Revert "fix: ignore window scroll event if it has bubbled there"
alexreardon Jun 27, 2019
0d62c68
scroll listener improvements
alexreardon Jun 27, 2019
a906538
fixing tests
alexreardon Jun 27, 2019
fe1d837
moving to reduce
alexreardon Jun 27, 2019
0157291
fixing more tests
alexreardon Jun 30, 2019
e3033aa
fixing tests
alexreardon Jul 1, 2019
89f4e16
renaming test helper
alexreardon Jul 1, 2019
0600bdc
test fixing and refactoring
alexreardon Jul 1, 2019
562c6e3
get center from impact is boss
alexreardon Jul 1, 2019
9ab1a42
typing raf
alexreardon Jul 1, 2019
6e71a0e
more test fixes
alexreardon Jul 1, 2019
c9f0dd5
fixing test
alexreardon Jul 1, 2019
4dcbd92
fixing foreign list test
alexreardon Jul 1, 2019
2b54bfd
renaming files
alexreardon Jul 1, 2019
e5f180e
fixing another test
alexreardon Jul 1, 2019
2f452ef
more test fixes
alexreardon Jul 1, 2019
33f137d
removing old comments
alexreardon Jul 2, 2019
e152d0d
state visibility tests
alexreardon Jul 3, 2019
00c89ef
renaming folder
alexreardon Jul 3, 2019
5af2c3e
wip
alexreardon Jul 3, 2019
60fcea9
visibility overscanning tests
alexreardon Jul 3, 2019
3d70ffc
refactoring getForcedDisplacement helper
alexreardon Jul 3, 2019
eb52c4b
a11y: adds lighthouse a11y auditing
stacylondon Jun 27, 2019
7ad5993
add a11y auditing (#1386)
alexreardon Jul 3, 2019
06774cc
Merge remote-tracking branch 'origin/virtual' into accessibility-audit
alexreardon Jul 3, 2019
85f1b6e
Accessibility audit (#1385)
alexreardon Jul 4, 2019
3bccc94
rename
alexreardon Jul 4, 2019
28d6ce8
wip
alexreardon Jul 4, 2019
6a4fc3a
axis tests
alexreardon Jul 4, 2019
e3fdd27
fixing axis tests
alexreardon Jul 4, 2019
858740e
renaming file
alexreardon Jul 4, 2019
0b95fa1
upgrading deps
alexreardon Jul 4, 2019
fa3d83d
test wip
alexreardon Jul 4, 2019
2aa13d1
adding empty tests
alexreardon Jul 5, 2019
0586e58
test updates
alexreardon Jul 5, 2019
a31f5d4
wip
alexreardon Jul 5, 2019
6fc40f7
cross axis test improvement
alexreardon Jul 5, 2019
4ee2e87
force should animate test
alexreardon Jul 5, 2019
85d09de
more tests for get-displacement-groups
alexreardon Jul 7, 2019
c219ea0
streamlining get displacement groups tests
alexreardon Jul 7, 2019
6eda543
fiixng flow types
alexreardon Jul 8, 2019
61cc32b
more flow fixes
alexreardon Jul 8, 2019
ae5d67e
fixing test
alexreardon Jul 8, 2019
b163def
fixing droppable scroll tests
alexreardon Jul 8, 2019
42161db
wip
alexreardon Jul 8, 2019
bdd262f
better comment for raf type
alexreardon Jul 9, 2019
328970c
bumping dependencies
alexreardon Jul 9, 2019
907a1ea
bumping redux
alexreardon Jul 9, 2019
b3787be
upgrading use-memo-one
alexreardon Jul 9, 2019
a70d961
over foreign list reorder test
alexreardon Jul 9, 2019
4f94c9a
combine drag impact tests
alexreardon Jul 9, 2019
22c1a8c
move ot next combine tests
alexreardon Jul 9, 2019
273fa48
adding workaround for forcepress
alexreardon Jul 11, 2019
8993438
v12.0.0-alpha.7
alexreardon Jul 11, 2019
2dc1930
registry initial build
alexreardon Jul 14, 2019
3bf0f88
pushing out registry
alexreardon Jul 14, 2019
e264854
wip
alexreardon Jul 14, 2019
e6d334c
creating helper
alexreardon Jul 14, 2019
7113061
not thrashing registry updates
alexreardon Jul 14, 2019
4d82ec3
draggable mid drag update
alexreardon Jul 14, 2019
aaf4b1e
starting events
alexreardon Jul 14, 2019
722a2fe
closing loop on new registry
alexreardon Jul 14, 2019
80fddb7
fixing mouse force press behaviour
alexreardon Jul 15, 2019
418ea65
removing old attribute
alexreardon Jul 15, 2019
2326f76
removing unused keys
alexreardon Jul 15, 2019
dd28648
force press tests
alexreardon Jul 15, 2019
f6bdb06
updating snapshots
alexreardon Jul 15, 2019
da65d43
fixing id
alexreardon Jul 15, 2019
d23d35f
fixing tests
alexreardon Jul 15, 2019
35e7e13
fixing overscanning tests
alexreardon Jul 15, 2019
4548a79
fixing test
alexreardon Jul 15, 2019
207616a
renaming
alexreardon Jul 15, 2019
aa83080
fixing strange test
alexreardon Jul 15, 2019
30608ee
move cross axis tests
alexreardon Jul 15, 2019
1297aba
recompute tests
alexreardon Jul 17, 2019
132fab1
cleanup file structure
alexreardon Jul 17, 2019
a685633
fixing speculative displacement test
alexreardon Jul 21, 2019
0d19d53
adding empty registry tests
alexreardon Jul 21, 2019
f2ad4ba
Merge branch 'master' of github.com:atlassian/react-beautiful-dnd int…
alexreardon Jul 22, 2019
213d2df
adding touch sensor fix
alexreardon Jul 22, 2019
987696f
adding the ability to cancel an active lock to the sensor marshal
alexreardon Jul 22, 2019
e607c5e
initial tests for registry
alexreardon Jul 22, 2019
c93f343
adding droppable registration tests
alexreardon Jul 22, 2019
ea3f3b2
more registry tests
alexreardon Jul 22, 2019
2dbf720
registry and dimension marshal cleanup
alexreardon Jul 22, 2019
1d5b88d
fixing more tests
alexreardon Jul 22, 2019
b8e16e0
renaming file
alexreardon Jul 22, 2019
ca526cd
drop impact tests
alexreardon Jul 23, 2019
187bd51
fixing more tests
alexreardon Jul 24, 2019
3b766df
fixing more tests
alexreardon Jul 24, 2019
1bf1fd5
converting to testing library
alexreardon Jul 24, 2019
8bdffb9
more registry tests
alexreardon Jul 25, 2019
8f6b5c4
testing wip
alexreardon Jul 25, 2019
c1ea327
more tests
alexreardon Jul 26, 2019
8302d87
no more creating a function in selector
alexreardon Jul 26, 2019
54a3bc7
adding yummy comment
alexreardon Jul 29, 2019
3696afa
removing some enzyme
alexreardon Jul 29, 2019
ff826bc
connected droppable tests
alexreardon Jul 29, 2019
7e8877b
moving repo health tests. cleaning up droppable validation
alexreardon Jul 29, 2019
790c6b5
Merge branch 'dev' into virtual
alexreardon Jul 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,31 @@ jobs:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
test-a11y:
docker:
- image: circleci/node:10.15.3-browsers
working_directory: ~/repo
steps:
- checkout

- restore_cache:
keys:
- v7-dependencies-{{ checksum "yarn.lock" }}

# PR's from forks cannot use the dependency cache for performance reasons
- run:
name: 'Forked PR dependency install'
command: yarn

- run:
name: Accessibility Audit
command: node browser-test-harness.js yarn test:accessibility

- store_artifacts:
path: test-reports/lighthouse

- store_test_results:
path: test-reports/lighthouse
workflows:
version: 2
build:
Expand All @@ -150,3 +175,6 @@ workflows:
- test-browser:
requires:
- install
- test-a11y:
requires:
- install
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ module.exports = {
message:
'Must use `useLayoutEffect` as the name of the import from `*use-isomorphic-layout-effect` to leverage `eslint-plugin-react-hooks`',
},

// No Array.from as it pulls in a large amount of babel helpers
{
selector: 'MemberExpression[object.name="Array"][property.name="from"]',
message:
'Not allowing using of Array.from to save kbs. Please use native-with-fallback/from',
},
],

// Allowing Math.pow rather than forcing `**`
Expand Down Expand Up @@ -162,6 +169,6 @@ module.exports = {
// Enforce rules of hooks
'react-hooks/rules-of-hooks': 'error',
// Second argument to hook functions
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/exhaustive-deps': 'error',
},
};
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ suppress_comment= \\(.\\|\n\\)*\\$ExpectError
include_warnings=true
# Fixing issue with CircleCI where flow would hang
# I suspect this is caused by incorrect advertisement of virtual cores
server.max_workers=1
# server.max_workers=1
24 changes: 12 additions & 12 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"dist/react-beautiful-dnd.js": {
"bundled": 392081,
"minified": 147079,
"gzipped": 41340
"bundled": 367592,
"minified": 138436,
"gzipped": 41559
},
"dist/react-beautiful-dnd.min.js": {
"bundled": 323864,
"minified": 116189,
"gzipped": 33372
"bundled": 316103,
"minified": 114634,
"gzipped": 34002
},
"dist/react-beautiful-dnd.esm.js": {
"bundled": 238384,
"minified": 123773,
"gzipped": 31477,
"bundled": 239478,
"minified": 124359,
"gzipped": 32332,
"treeshaked": {
"rollup": {
"code": 29975,
"import_statements": 793
"code": 20714,
"import_statements": 818
},
"webpack": {
"code": 33907
"code": 23865
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion .storybook/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"presets": [
"@babel/react",
"@babel/flow",
["@babel/env", { "modules": false, "loose": true }]
["@babel/env", { "modules": false, "loose": true }],
"@emotion/babel-preset-css-prop"
],
"plugins": [
"emotion",
["@babel/proposal-class-properties", { "loose": true }],
["@babel/proposal-object-rest-spread", { "loose": true }]
],
Expand Down
1 change: 0 additions & 1 deletion .storybook/decorator/global-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { colors } from '@atlaskit/theme';
import { grid } from '../../stories/src/constants';

const GlobalStyles = styled.div`
background-color: ${colors.N0};
min-height: 100vh;
color: ${colors.N900};
`;
Expand Down
9 changes: 9 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--

Used to ensure there is a lang set on the html attribute for storybook
This is important for accessibility scores

-->
<script>
document.documentElement.setAttribute('lang', 'en');
</script>
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ We have created [a free course on `egghead.io` 🥚](https://egghead.io/courses/
- Compatible with semantic `<table>` reordering - [table pattern](/docs/patterns/tables.md)
- [Auto scrolling](/docs/guides/auto-scrolling.md) - automatically scroll containers and the window as required during a drag (even with keyboard 🔥)
- Custom drag handles - you can drag a whole item by just a part of it
- Compatible with [`ReactDOM.createPortal`](https://reactjs.org/docs/portals.html) - [portal pattern](/docs/patterns/using-a-portal.md)
- Able to drag a [clone](TODO) or use a [portal](/docs/patterns/using-a-portal.md)
- Full [programmatic api 🎮](/docs/api/programmatic.md)
- 🌲 Tree support through the [`@atlaskit/tree`](https://atlaskit.atlassian.com/packages/core/tree) package
- A `<Droppable />` list can be a scroll container (without a scrollable parent) or be the child of a scroll container (that also does not have a scrollable parent)
- Independent nested lists - a list can be a child of another list, but you cannot drag items from the parent list into a child list
Expand Down Expand Up @@ -85,6 +86,7 @@ There are a lot of libraries out there that allow for drag and drop interactions
- [Mouse dragging 🐭](/docs/sensors/mouse.md)
- [Touch dragging 👉📱](/docs/sensors/touch.md)
- [Keyboard dragging 🎹♿️](/docs/sensors/keyboard.md)
- [Programmatic dragging 🎮](/docs/sensors/programmatic.md)

### API 🏋️‍

Expand Down
23 changes: 23 additions & 0 deletions a11y-audit-parse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
try {
const a11yReport = require('./test-reports/lighthouse/a11y.report.json');
const a11yScore = a11yReport.categories.accessibility.score;
const a11yScoreFormatted = `${a11yScore ? a11yScore * 100 : 0}%`;

console.log('*************************');
console.log('a11y score: ', a11yScoreFormatted);
console.log('*************************');

if (a11yScore === 1) {
// success!
process.exit(0);
} else {
// fail build
console.log(
'\nNOTE: Lighthouse accessibility audit score must be 100% to pass this build step.\n\n',
);
process.exit(1);
}
} catch (e) {
console.error(e);
process.exit(1);
}
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
presets: ['@babel/react', '@babel/flow', ['@babel/env', { loose: true }]],
plugins: [
['@babel/proposal-class-properties', { loose: true }],
'emotion',
// used for stripping out the `invariant` messages in production builds
'dev-expression',
],
Expand Down
148 changes: 148 additions & 0 deletions cypress/integration/focus.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
// @flow
import * as keyCodes from '../../src/view/key-codes';
import { getHandleSelector, getDraggableSelector } from './util';

beforeEach(() => {
cy.visit('/iframe.html?id=board--dragging-a-clone');
});

it('should not steal focus if not already focused when lifting', () => {
// focusing on another handle
cy.get(getHandleSelector('1')).focus();
cy.focused().should('contain', 'id:1');

cy.get(getHandleSelector('2'))
.as('id:2')
.trigger('mousedown', { button: 0 })
.trigger('mousemove', {
button: 0,
clientX: 200,
clientY: 300,
force: true,
});

// asserting id:2 is now dragging
cy.get(getHandleSelector('2')).should(
'have.attr',
'data-is-dragging',
'true',
);

// focus not stolen
cy.focused().should('contain', 'id:1');

cy.get(getHandleSelector('2'))
.trigger('mouseup', { force: true })
// clone will be unmounting during drop
.should('not.exist');

// getting post clone handle
cy.get(getHandleSelector('2')).should(
'have.attr',
'data-is-dragging',
'false',
);

// focus not stolen
cy.focused().should('contain', 'id:1');
});

it('should maintain focus if dragging a clone', () => {
// focusing on another handle
cy.get(getHandleSelector('2')).focus();
cy.focused().should('contain', 'id:2');

cy.get(getHandleSelector('2')).trigger('keydown', {
keyCode: keyCodes.space,
});

// asserting id:2 is now dragging
cy.get(getHandleSelector('2')).should(
'have.attr',
'data-is-dragging',
'true',
);

// focus maintained
cy.focused().should('contain', 'id:2');

cy.get(getHandleSelector('2'))
.trigger('keydown', { keyCode: keyCodes.arrowRight, force: true })
.trigger('keydown', { keyCode: keyCodes.space, force: true })
// clone will be unmounting during drop
.should('not.exist');

// getting post clone handle
cy.get(getHandleSelector('2'))
// no longer dragging
.should('have.attr', 'data-is-dragging', 'false')
// is in the second column (normally would loose focus moving between lists)
.closest(getDraggableSelector('BMO'));

// focus maintained
cy.focused().should('contain', 'id:2');
});

it('should give focus to a combine target', () => {
cy.visit('/iframe.html?id=board--with-combining-and-cloning');
cy.get(getHandleSelector('2')).focus();
cy.focused().should('contain', 'id:2');

cy.get(getHandleSelector('2')).trigger('keydown', {
keyCode: keyCodes.space,
});

// asserting id:2 is now dragging
cy.get(getHandleSelector('2')).should(
'have.attr',
'data-is-dragging',
'true',
);

// focus maintained
cy.focused().should('contain', 'id:2');

cy.get(getHandleSelector('2'))
.trigger('keydown', { keyCode: keyCodes.arrowRight, force: true })
// combining with item:1
.trigger('keydown', { keyCode: keyCodes.arrowUp, force: true })
// dropping
.trigger('keydown', { keyCode: keyCodes.space, force: true })
// clone will be unmounting during drop
.should('not.exist');

// focus giving to item:1 the combine target
cy.focused().should('contain', 'id:1');
});

it('should not give focus to a combine target if source did not have focus at start of drag', () => {
cy.visit('/iframe.html?id=board--with-combining-and-cloning');
// focusing on something unrelated to the drag
cy.get(getHandleSelector('3')).focus();

cy.get(getHandleSelector('2')).trigger('keydown', {
keyCode: keyCodes.space,
});

// asserting id:2 is now dragging
cy.get(getHandleSelector('2')).should(
'have.attr',
'data-is-dragging',
'true',
);

// focus not stolen
cy.focused().should('contain', 'id:3');

cy.get(getHandleSelector('2'))
.trigger('keydown', { keyCode: keyCodes.arrowRight, force: true })
// combining with item:1
.trigger('keydown', { keyCode: keyCodes.arrowUp, force: true })
// dropping
.trigger('keydown', { keyCode: keyCodes.space, force: true })
// clone will be unmounting during drop
.should('not.exist');

// focus not given to the combine target
cy.focused().should('contain', 'id:3');
});
7 changes: 4 additions & 3 deletions cypress/integration/move-between-lists.spec.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
// @flow
import * as keyCodes from '../../src/view/key-codes';
import { timings } from '../../src/animation';
import { getDroppableSelector, getHandleSelector } from './util';

beforeEach(() => {
cy.visit('/iframe.html?id=board--simple');
});

it('should move between lists', () => {
// first list has item with id:2
cy.get('[data-react-beautiful-dnd-droppable]')
cy.get(getDroppableSelector())
.eq(1)
.as('first-list')
.should('contain', 'id:2');

// second list does not have item with id:2
cy.get('[data-react-beautiful-dnd-droppable]')
cy.get(getDroppableSelector())
.eq(2)
.as('second-list')
.should('not.contain', 'id:2');

cy.get('@first-list')
.find('[data-react-beautiful-dnd-drag-handle]')
.find(getHandleSelector())
.first()
.should('contain', 'id:2')
.focus()
Expand Down
Loading