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

[Transition] Add easing prop to override default timing function #25245

Merged

Conversation

jeferson-sb
Copy link
Contributor

@jeferson-sb jeferson-sb commented Mar 7, 2021

  • I have followed (at least) the PR section of the contributing guide.

  • Add easing (transition timing function) property to transition components to be able override the default style on enter and leave animations, similar to how timeout is set up.

<Zoom 
  easing={{
    enter: 'cubic-bezier(0.71, 0.11, 0.35, 1.28)',
    exit: 'cubic-bezier(1,.18,.74,1.03)',
   }}
>
  • Update type definitions and related API docs

Fix #24980

@mui-pr-bot
Copy link

mui-pr-bot commented Mar 7, 2021

@material-ui/lab: parsed: +0.09% , gzip: +0.06%

Details of bundle changes

Generated by 🚫 dangerJS against 9656a78

@oliviertassinari oliviertassinari force-pushed the feature/add-easing-prop-transition branch from deafa05 to fb13a5c Compare March 7, 2021 15:53
@oliviertassinari oliviertassinari added component: transitions This is the name of the generic UI component, not the React module! new feature New feature or request labels Mar 7, 2021
@oliviertassinari oliviertassinari force-pushed the feature/add-easing-prop-transition branch from c26daa3 to 31db850 Compare March 7, 2021 16:08
@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 7, 2021

I have updated the pull request to remove the change of default transitions. See https://material.io/design/motion/speed.html#easing for why the new defaults seem to be not be correct. I think that It's also outside of the scope of the problem we are trying to solve.

@jeferson-sb
Copy link
Contributor Author

jeferson-sb commented Mar 8, 2021

@oliviertassinari oh I didn't know that, thanks for the updates :)

@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 9, 2021

I have added one test case to have a minimum of coverage on the approach.

Looking at how we test the transition helpers, something feels slitly wrong. We should probably abstract the tests as we do in describeConformance. Currently it seems that we have a lot of duplicated code. I don't see any reason for two different transitions to substantially have different behaviors.

@oliviertassinari oliviertassinari merged commit cce45de into mui:next Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: transitions This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Transition] Allow overriding the easing/timing function
3 participants