-
-
Notifications
You must be signed in to change notification settings - Fork 117
fix(Image): Image mask fade enter blur transition does not work #492
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
d3b489a
d98a9ed
7150f88
7ef9fcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ describe('Controlled', () => { | |
| jest.runAllTimers(); | ||
| }); | ||
|
|
||
| expect(document.querySelector('.rc-image-preview')).toBeFalsy(); | ||
| expect(document.querySelector('.rc-image-preview')).toBeTruthy(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check the Preview component's Portal and CSSMotion configuration
rg -n "Portal|CSSMotion" src/Preview/index.tsx -B 3 -A 3Repository: react-component/image Length of output: 1595 🏁 Script executed: # Check the test file context to understand what's being tested
head -50 tests/controlled.test.tsxRepository: react-component/image Length of output: 1358 🏁 Script executed: # Look at the specific test around line 34
sed -n '25,45p' tests/controlled.test.tsxRepository: react-component/image Length of output: 611 🏁 Script executed: # Check if there's cleanup logic for portalRender
rg -n "setPortalRender" src/Preview/index.tsx -B 2 -A 2Repository: react-component/image Length of output: 313 🏁 Script executed: # Check Portal documentation or types to understand its behavior
rg -n "autoDestroy|removeOnLeave|unmountOnExit" src/Preview/index.tsxRepository: react-component/image Length of output: 47 🏁 Script executed: # Look at the complete useLayoutEffect hook for Portal setup
sed -n '375,390p' src/Preview/index.tsxRepository: react-component/image Length of output: 530 🏁 Script executed: # Check if there's a cleanup effect that sets portalRender to false
sed -n '375,410p' src/Preview/index.tsxRepository: react-component/image Length of output: 1281 🏁 Script executed: # Check if there's a cleanup effect that should set portalRender to false
rg -n "useLayoutEffect|useEffect" src/Preview/index.tsx | head -20Repository: react-component/image Length of output: 348 🏁 Script executed: # Look for any other places where portalRender might be reset
rg -n "portalRender" src/Preview/index.tsxRepository: react-component/image Length of output: 259 🏁 Script executed: # Check if there are any comments or logic around the Portal behavior
sed -n '370,420p' src/Preview/index.tsxRepository: react-component/image Length of output: 1702 🏁 Script executed: # Check what onVisibleChanged does in the component
rg -n "onVisibleChanged" src/Preview/index.tsx -B 5 -A 5Repository: react-component/image Length of output: 730 🏁 Script executed: # Look for the onVisibleChanged implementation
sed -n '350,375p' src/Preview/index.tsxRepository: react-component/image Length of output: 676 🏁 Script executed: # Check if there's any logic in onVisibleChanged that should clean up portalRender
rg -n "const onVisibleChanged" src/Preview/index.tsx -A 15Repository: react-component/image Length of output: 566 🏁 Script executed: # Check the full context around the Portal and CSSMotion to understand complete flow
sed -n '375,450p' src/Preview/index.tsxRepository: react-component/image Length of output: 2687 🏁 Script executed: # Check if Portal component unmounts content when open={false} even if portalRender is true
rg -n "Portal" src/Preview/index.tsx -A 1 | head -20Repository: react-component/image Length of output: 601 🏁 Script executed: # Look at the test again to see what was the previous expectation
git log --oneline -20 tests/controlled.test.tsx 2>/dev/null || echo "Git not available, checking for version history"Repository: react-component/image Length of output: 136 🏁 Script executed: # Check if Portal has any mechanism to unmount when its open prop is false
rg -n "portal" src/ -i | grep -i "destroy\|unmount\|remove" | head -10Repository: react-component/image Length of output: 47 🏁 Script executed: # Look at the git diff or commit message to understand the intent
git show --stat 7150f88 2>/dev/null | head -30 || echo "Can't show commit"Repository: react-component/image Length of output: 1505 🏁 Script executed: # Check if there's any issue or comment about this design decision
rg -n "portalRender\|Portal.*open\|root.*always\|element.*mount" src/Preview/index.tsx -B 2 -A 2Repository: react-component/image Length of output: 47 🏁 Script executed: # Look at what the Portal component type expects
rg -n "type PortalProps\|interface PortalProps" -A 10Repository: react-component/image Length of output: 47 🏁 Script executed: # Check if there's a cleanup effect that should reset portalRender
sed -n '376,385p' src/Preview/index.tsxRepository: react-component/image Length of output: 344 🏁 Script executed: # Look at the entire useLayoutEffect hook to see if there's cleanup logic
ast-grep --pattern $'useLayoutEffect(() => {
$$$
}, [$$$])'Repository: react-component/image Length of output: 285 🏁 Script executed: # Check the actual behavior: does Portal unmount its content when open={false}?
rg -n "open.*false\|Portal.*behavior" . -i | head -10Repository: react-component/image Length of output: 47 🏁 Script executed: # Check if there's a second useEffect that should clean up portalRender
sed -n '375,500p' src/Preview/index.tsx | grep -A 20 "useLayoutEffect\|useEffect"Repository: react-component/image Length of output: 784 🏁 Script executed: # Check the complete useLayoutEffect and surrounding code more carefully
sed -n '362,385p' src/Preview/index.tsxRepository: react-component/image Length of output: 655 🏁 Script executed: # Check if Portal component from @rc-component/portal unmounts when open={false}
web_search @rc-component/portal open property behavior unmountRepository: react-component/image Length of output: 115 🏁 Script executed: # Look at the test again - what was the original expectation before this change?
git log --all --oneline tests/controlled.test.tsx 2>/dev/null | head -5Repository: react-component/image Length of output: 310 🏁 Script executed: # Check if there are other tests that verify the unmount behavior
rg -n "toBeFalsy\|toBeTruthy" tests/controlled.test.tsxRepository: react-component/image Length of output: 47 🏁 Script executed: # Check the git diff for this specific commit to see what changed
git show 7150f88 -- src/Preview/index.tsx | head -100Repository: react-component/image Length of output: 3137 🏁 Script executed: # Check if there's a second effect that should clean up portalRender
sed -n '375,385p' src/Preview/index.tsx | cat -ARepository: react-component/image Length of output: 421 🏁 Script executed: # Look at the entire file around Portal to see if there's cleanup logic we missed
sed -n '375,390p' src/Preview/index.tsxRepository: react-component/image Length of output: 530 🏁 Script executed: # Check if the previous commit (502ca38) has the Portal unmount logic
git show 502ca38:src/Preview/index.tsx 2>/dev/null | grep -A 10 "Portal\|portalRender" | head -30Repository: react-component/image Length of output: 1132 🏁 Script executed: # Check all useEffect/useLayoutEffect hooks in the Preview component
rg -n "useEffect|useLayoutEffect" src/Preview/index.tsx -A 8Repository: react-component/image Length of output: 1926 🏁 Script executed: # Verify the exact behavior - check if Portal.open controls unmounting
rg -n "Portal.*open\|open.*Portal" src/Preview/index.tsx -B 2 -A 2Repository: react-component/image Length of output: 47 🏁 Script executed: # Check if onVisibleChanged should be resetting portalRender
sed -n '368,410p' src/Preview/index.tsxRepository: react-component/image Length of output: 1436 🏁 Script executed: # Check the previous version to see what the old Portal behavior was
git show 502ca38:src/Preview/index.tsx | sed -n '200,250p'Repository: react-component/image Length of output: 1179 🏁 Script executed: # Look at the old test expectation before the change
git show 502ca38:tests/controlled.test.tsx | sed -n '30,40p'Repository: react-component/image Length of output: 372 🌐 Web query:
💡 Result: Summary — @rc-component/portal "open" prop
Source: package README/API. [1] 补充缺失的清理逻辑以正确卸载 Portal
应在 🤖 Prompt for AI Agents
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 你的这个问题在逻辑上没有错误,我实际测试过,若添加setPortalRender(false),动画会有问题 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }); | ||
|
|
||
| it('controlled current in group', () => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.