-
Notifications
You must be signed in to change notification settings - Fork 143
[CLNP-6892][fix]: Fix search result click not triggering bounce animation #1422
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
Changes from 5 commits
f5df1f9
f15d983
9a8bcf7
eec9426
2e3a135
17109ad
cc87b64
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 |
|---|---|---|
|
|
@@ -300,17 +300,23 @@ const GroupChannelManager :React.FC<React.PropsWithChildren<GroupChannelProvider | |
| }; | ||
| }, [messageDataSource.initialized, state.currentChannel?.url]); | ||
|
|
||
| // Starting point handling | ||
| // Starting point handling — skip when animated message handles scroll | ||
| useEffect(() => { | ||
| if (typeof startingPoint === 'number' && state.initialized) { | ||
| if (typeof startingPoint === 'number' && state.initialized && !_animatedMessageId) { | ||
| actions.scrollToMessage(startingPoint, 0, false, false); | ||
| } | ||
| }, [state.initialized, startingPoint]); | ||
|
|
||
| // Animated message handling | ||
| // Animated message handling — scroll + animation | ||
| useEffect(() => { | ||
| if (_animatedMessageId) { | ||
| actions.setAnimatedMessageId(_animatedMessageId); | ||
| if (typeof startingPoint === 'number') { | ||
| // Search result click: scroll to message and animate | ||
| actions.scrollToMessage(startingPoint, _animatedMessageId, true, false); | ||
| } else { | ||
|
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.
When Useful? React with 👍 / 👎.
Contributor
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. Good catch — fixed in the latest commit. The animated-message effect now also depends on useEffect(() => {
if (_animatedMessageId && state.initialized) {
if (typeof startingPoint === 'number') {
actions.scrollToMessage(startingPoint, _animatedMessageId, true, false);
} else {
actions.setAnimatedMessageId(_animatedMessageId);
}
}
}, [_animatedMessageId, state.initialized]);Thanks! |
||
| // Thread parent jump: scroll already handled by startingPoint effect, just animate | ||
| actions.setAnimatedMessageId(_animatedMessageId); | ||
| } | ||
| } | ||
| }, [_animatedMessageId]); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fallback으로 cleanup이 되는 부분이 필요가 없을까요? Uikit이 custom render를 제공하고 있어서, 정확한 루트로 진행이 안 될 수도 있습니다. fallback clean up이 가능하다면 같이 있으면 좋을 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
말씀하신 대로
bouncekeyframe 이 디센던트.sendbird-message-content에 걸려 있어서 customrenderMessage결과물에 그 클래스가 없으면onAnimationEnd가 발화되지 않아 animation state 가 stuck 되는 회귀가 있었습니다.최신 커밋에서 fallback
setTimeout을 추가해 CSS animation duration(1s) + 버퍼 후 강제 정리하도록 수정했습니다.fallbackTimerRef로 timer 추적 →handleAnimationEnd가 정상 발화하면 clear 해서 이중 정리 방지[isAnimationTarget]만 의존하도록 안정화 → 부모가onMessageAnimated를 memoize 하지 않아도 fallback timer 가 조기 clear 되지 않게 처리했습니다감사합니다!