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

Fix enter transitions for the Transition component #3074

Merged
merged 27 commits into from
Apr 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f27367d
improve `transition` logic
RobinMalfait Mar 30, 2024
123fd32
simplify check
RobinMalfait Mar 30, 2024
3513a70
updating playgrounds to improve transitions
RobinMalfait Mar 30, 2024
d0e4787
update changelog
RobinMalfait Apr 2, 2024
025fd7d
track in-flight transitions
RobinMalfait Apr 2, 2024
5c2d990
document `disposables()` and `useDisposables()` functions
RobinMalfait Apr 3, 2024
fb59c52
ensure we alway return a cleanup function
RobinMalfait Apr 3, 2024
3204ea4
move comment
RobinMalfait Apr 3, 2024
f08b995
apply `enterTo` or `leaveTo` classes once we are done transitioning
RobinMalfait Apr 3, 2024
bf11592
cleanup & simplify logic
RobinMalfait Apr 3, 2024
5fcd736
update comment
RobinMalfait Apr 3, 2024
5b86274
fix another bug + update tests
RobinMalfait Apr 3, 2024
b28c2a5
add failing test as playground
RobinMalfait Apr 3, 2024
7b2fb84
simplify event callbacks
RobinMalfait Apr 3, 2024
ce083ca
use existing `useOnDisappear` hook
RobinMalfait Apr 3, 2024
893563d
remove repro
RobinMalfait Apr 3, 2024
b905bf8
only unmount if we are not transitioning ourselves
RobinMalfait Apr 3, 2024
8682bac
`show` is already guaranteed to be a boolean
RobinMalfait Apr 3, 2024
6aa5789
cleanup temporary test changes
RobinMalfait Apr 3, 2024
9acfe6c
Update packages/@headlessui-react/src/components/transition/utils/tra…
RobinMalfait Apr 5, 2024
5b796d9
Update packages/@headlessui-react/src/components/transition/utils/tra…
RobinMalfait Apr 5, 2024
b3cabac
Update packages/@headlessui-react/src/components/transition/utils/tra…
RobinMalfait Apr 5, 2024
53b8471
Update packages/@headlessui-react/src/components/transition/utils/tra…
RobinMalfait Apr 5, 2024
53d8afb
Update packages/@headlessui-react/src/utils/disposables.ts
RobinMalfait Apr 5, 2024
1c60486
Update packages/@headlessui-react/src/components/transition/transitio…
RobinMalfait Apr 5, 2024
ae8c51d
Update packages/@headlessui-react/src/components/transition/transitio…
RobinMalfait Apr 5, 2024
3b310f1
run prettier
RobinMalfait Apr 5, 2024
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
Prev Previous commit
Next Next commit
Update packages/@headlessui-react/src/components/transition/utils/tra…
…nsition.ts

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
  • Loading branch information
RobinMalfait and reinink authored Apr 5, 2024
commit 5b796d9af9a925f751fe50f3704f871804f423c3
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export function transition(
// 3. When you use `getComputedStyle` and read any returned value
// 4. Then the `transition` immediately jumps to the end state
//
// This means that no transition happen at all. To fix this, we delay the
// actual transition by one frame. This fixes the bug.
// This means that no transition happens at all. To fix this, we delay the
// actual transition by one frame.
d.nextFrame(() => {
// Wait for the transition, once the transition is complete we can cleanup.
// This is registered first to prevent race conditions, otherwise it could
Expand Down