Skip to content

fix: trigger thumb animation when selected changed #31

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

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

vagusX
Copy link
Member

@vagusX vagusX commented Apr 22, 2022

@vagusX vagusX requested a review from zombieJ April 22, 2022 09:03
@github-actions
Copy link

github-actions bot commented Apr 22, 2022

🎊 PR Preview ac11587 has been successfully built and deployed to https://react-component-segmented-preview-pr-31.surge.sh

🕐 Build time: 187.02s

🤖 By surge-preview

@vagusX vagusX force-pushed the fix/antd-issue-35170 branch from fc12c00 to 43e60c7 Compare April 22, 2022 09:04
@vagusX vagusX changed the title fix: trigger thumb animation when selected changed WIP: fix: trigger thumb animation when selected changed Apr 22, 2022
@codecov
Copy link

codecov bot commented Apr 22, 2022

Codecov Report

Merging #31 (ac11587) into master (a9f646c) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #31   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           72        84   +12     
  Branches        13        18    +5     
=========================================
+ Hits            72        84   +12     
Impacted Files Coverage Δ
src/index.tsx 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@vagusX vagusX changed the title WIP: fix: trigger thumb animation when selected changed fix: trigger thumb animation when selected changed Apr 22, 2022
(typeof selected === 'string' || typeof selected === 'number') &&
selected !== latestVisualSelected.current
) {
doThumbAnimation(selected);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 用了 latestVisualSelected 避免监听 visualSelected 的 change
  • 剥离 doThumbAnimation 方法避免额外依赖项

cc @zombieJ

@vagusX vagusX merged commit cb2be8c into master Apr 22, 2022
@vagusX vagusX deleted the fix/antd-issue-35170 branch April 22, 2022 09:46
@vagusX
Copy link
Member Author

vagusX commented Apr 22, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmented component highlighted option doesn't change on value change
1 participant