Repository navigation
Commit 71afa62
committed
refactor(core): BottomSheet's drag runs on the gesture recognizers
The sheet's input moves from its own pointer and touch listeners onto the
shared gesture host:
- the handle's pan: vertical, one touch, any pointer, no text selection;
- the body's pans: a pull down from the content's top edge (`scrollEdge`,
any pointer), and for a finger or pen a push up at the content's end
that also takes over a scroll that runs out mid-gesture (`scrollEdge` and
`scrollHandoff`), only below the tallest detent. At the edge both claim
the touch early (5 px), under WebKit's own slow-drag claim, so a slow
pull never becomes the content's overscroll;
- a touch-down watcher (a long press of no duration that never claims)
that catches a settling sheet where it is drawn;
- the host's presented hit-testing replaces the dialog's capture
listeners, and its blur and visibility handling the sheet's own.
The release velocity is the pan's (spec:AST-100's filter): under a mouse it
is the same blend as a finger's instead of the last 100 ms, and a pointer
held still for more than 40 ms reads 0. Pans begin only while the host
counts one finger on the screen (two are the browser's pinch); a drag that
has begun keeps its finger when another lands (spec:AST-094 FR10). The pan
reports UIKit's translation, which leaves out the 10 px before it begins.
The scroll hand-off (`scrollEdge` with `scrollHandoff`) is today's.
The tests drive the hook and the component through the host with real
touch and pointer events on explicit timestamps.1 parent 6dbfa9c commit 71afa62
7 files changed
Lines changed: 1429 additions & 1764 deletions
File tree
- .changeset
- packages/core/src/BottomSheet
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
226 | 250 | | |
227 | | - | |
228 | | - | |
| 251 | + | |
229 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
230 | 257 | | |
231 | | - | |
232 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
233 | 272 | | |
234 | | - | |
235 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
236 | 311 | | |
237 | 312 | | |
238 | 313 | | |
| |||
284 | 359 | | |
285 | 360 | | |
286 | 361 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
297 | 378 | | |
298 | 379 | | |
299 | 380 | | |
| |||
1077 | 1158 | | |
1078 | 1159 | | |
1079 | 1160 | | |
| 1161 | + | |
| 1162 | + | |
1080 | 1163 | | |
1081 | 1164 | | |
1082 | 1165 | | |
| 1166 | + | |
1083 | 1167 | | |
1084 | 1168 | | |
1085 | 1169 | | |
1086 | 1170 | | |
1087 | | - | |
1088 | 1171 | | |
1089 | 1172 | | |
1090 | 1173 | | |
| |||
1108 | 1191 | | |
1109 | 1192 | | |
1110 | 1193 | | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
| 1194 | + | |
| 1195 | + | |
1118 | 1196 | | |
1119 | 1197 | | |
1120 | 1198 | | |
| |||
2226 | 2304 | | |
2227 | 2305 | | |
2228 | 2306 | | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
| 2307 | + | |
2235 | 2308 | | |
2236 | 2309 | | |
2237 | 2310 | | |
2238 | | - | |
| 2311 | + | |
2239 | 2312 | | |
2240 | 2313 | | |
2241 | 2314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
37 | 104 | | |
38 | 105 | | |
39 | 106 | | |
| |||
773 | 840 | | |
774 | 841 | | |
775 | 842 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
| 843 | + | |
| 844 | + | |
788 | 845 | | |
789 | 846 | | |
790 | 847 | | |
| |||
796 | 853 | | |
797 | 854 | | |
798 | 855 | | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
| 856 | + | |
804 | 857 | | |
805 | 858 | | |
806 | 859 | | |
| |||
970 | 1023 | | |
971 | 1024 | | |
972 | 1025 | | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
981 | 1029 | | |
982 | 1030 | | |
983 | 1031 | | |
| |||
1040 | 1088 | | |
1041 | 1089 | | |
1042 | 1090 | | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1051 | 1094 | | |
1052 | 1095 | | |
1053 | 1096 | | |
| |||
1071 | 1114 | | |
1072 | 1115 | | |
1073 | 1116 | | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
| 1117 | + | |
| 1118 | + | |
1081 | 1119 | | |
1082 | 1120 | | |
1083 | 1121 | | |
| |||
0 commit comments