Skip to content

fix: trigger "onMotionEnd" when element is hidden #161

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 4 commits into from
Jan 17, 2023
Merged

fix: trigger "onMotionEnd" when element is hidden #161

merged 4 commits into from
Jan 17, 2023

Conversation

luo3house
Copy link
Contributor

Fix: ant-design/ant-design#40237

In this PR, MotionThumb is able to detect the hidden item wrapped into "Modal" during forceRender and visible={false} options. Then ignore them and trigger onMotionEnd() to place "selected" classname for segment item.

@luo3house luo3house changed the title fix: end animation when element is hidden fix: trigger "onMotionEnd" when element is hidden Jan 16, 2023
@afc163 afc163 requested review from zombieJ and vagusX January 16, 2023 05:31
@codecov
Copy link

codecov bot commented Jan 17, 2023

Codecov Report

Merging #161 (8bb159e) into master (3cc5ac5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #161   +/-   ##
=======================================
  Coverage   99.11%   99.11%           
=======================================
  Files           2        2           
  Lines         113      113           
  Branches       28       29    +1     
=======================================
  Hits          112      112           
  Misses          1        1           
Impacted Files Coverage Δ
src/MotionThumb.tsx 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor Author

@luo3house luo3house left a comment

Choose a reason for hiding this comment

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

Thanks for the tip. Is it also possible to change any typing below?
OK I have understood changing it to string breaks onChange type check

const [value, setValue] = React.useState<any>('Web3');

@vagusX vagusX merged commit adf0461 into react-component:master Jan 17, 2023
@luo3house luo3house deleted the draft-antd-40237 branch January 17, 2023 10:28
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 not rendering properly after setState()
4 participants