Commit 3224a9e
authored
* always wrap `Dialog` in a `Transition`
Initially we didn't do this, because it's a bit silly to do that if you
already had a `Transition` component on the outside. E.g.:
```tsx
<Transition show={open}>
<Dialog onClose={() => setOpen(false)}>
{/* ... */}
</Dialog>
</Transition>
```
Because this means that we technically have this:
```tsx
<Transition show={open}>
<Dialog onClose={() => setOpen(false)}>
<Transition>
<InternalDialog>
{/* ... */}
</InternalDialog>
</Dialog>
</Transition>
</Transition>
```
The good part is that the inner `Transition` is rendering a `Fragment`
and forwards all the props to the underlying element (the internal
dialog).
This way we have a guaranteed transition boundary.
* use public `transition` API instead of private internal API
This also mimics better what we are actually trying to do.
* update changelog
1 parent 275c205 commit 3224a9e
File tree
3 files changed
+39
-14
lines changed- packages/@headlessui-react
- src/components/dialog
3 files changed
+39
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
Lines changed: 37 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
501 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
502 | 527 | | |
503 | | - | |
504 | | - | |
| 528 | + | |
| 529 | + | |
505 | 530 | | |
506 | 531 | | |
507 | 532 | | |
508 | 533 | | |
509 | | - | |
| 534 | + | |
510 | 535 | | |
511 | 536 | | |
512 | 537 | | |
513 | | - | |
| 538 | + | |
514 | 539 | | |
515 | 540 | | |
516 | 541 | | |
517 | 542 | | |
518 | | - | |
519 | | - | |
| 543 | + | |
| 544 | + | |
520 | 545 | | |
521 | 546 | | |
522 | 547 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
394 | | - | |
| 393 | + | |
395 | 394 | | |
396 | 395 | | |
397 | 396 | | |
| |||
0 commit comments