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

[Ripples] - transition issues when view disposed #1416

Closed
chrismcv opened this issue Aug 14, 2015 · 3 comments
Closed

[Ripples] - transition issues when view disposed #1416

chrismcv opened this issue Aug 14, 2015 · 3 comments
Labels
component: menu This is the name of the generic UI component, not the React module! component: transitions This is the name of the generic UI component, not the React module!

Comments

@chrismcv
Copy link
Contributor

Hi,
So we're using react router, and one of our use cases it to use a new style IconMenu to do a this.context.router.transitionTo('somewhere_new').

What we're seeing is that if the View we transition to doesn't contain the IconMenu then we get
Uncaught TypeError: Cannot read property 'componentDidEnter' of undefined.

This is happening in ReactTransitionGroup

 _handleDoneEntering: function(key) {
    var component = this.refs[key];
    if (component.componentDidEnter) {
      component.componentDidEnter();
    }

    delete this.currentlyTransitioningKeys[key];

    var currentChildMapping = ReactTransitionChildMapping.getChildMapping(
      this.props.children
    );

    if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
      // This was removed before it had fully entered. Remove it.
      this.performLeave(key);
    }
  },

I think it's because the Menu is being removed from the DOM before the transition completes.

We also have a custom "Popover" class with a "Close" button and we see the same behaviour in it.

Transitions are one of those areas I'm not massively sure about, so any guidance in how to fix would be great. I'll happily submit a PR, but will need a little steer.

Thanks,
Chris

@hai-cea
Copy link
Member

hai-cea commented Aug 14, 2015

@THemming
Copy link

@hai-cea Thanks for the suggestion. I'm getting the same issue in material-ui v0.10.4. I tried the following patch locally in CircleRipple._initializeAnimation and it fixes the issue:

setTimeout(function() {
    if (this.isMounted()) callback();
}.bind(this), 0);

@oliviertassinari
Copy link
Member

I'm experiencing the same error.

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
* Redesign datepicker toolbar

* Add optinal chaining support

* Redesign calendar view and switching between to year view

* Small bugfixes and improvements

* Add weekdays

* Redesign year selection

* Cleanup and remove not used files

* Add typings for style overrdies  of MuiBasePickerO, closes mui#1414

* New animations 😍

* Update lib/src/views/Calendar/CalendarView.tsx

Co-Authored-By: Olivier Tassinari <[email protected]>

* Start cypress component tests

* Address PR feedback

* Add alternative way to display ampm controls

* Redesign TimePickers

* Redesign DateTimePicker

* Fix build errors

* Convert ModalDialog to hook based styles

* Remove unused stuff from dependencies

* Fix ts build errros

* Turn off empty interface rule

* Fix rollup error

* Fix displaying toolbars in firefox and safari

* Replace theme.spacing( ) with static values

* Fix examples with custom theme

* Fix a bunch of tests

* Fix tests

* Rename cypress lib test file

* Fix CI

* Fix ts build errors

* Replace global keydown handler in favor of per component

* Fix timepicker switching to next view on scroll

* Use object to create styles without theme

* Rename MuiThemeProvider to ThemeProvider

* Remove zIndex from am/pm buttons

* Fix ts error

* Fix ts issues

* [CI] Split build and lint to different workflows

* Attach workspace for new jobs

* Remove console.log

* Fix luxon tests

* Remove animateYearScrolling from examples

* Do not run docgen on test changes

* Rename data-test-id to data-mui-test and remove test attributes in production

* Remove animateYearScrolling prop

* Improve new props api documentation

* Fix z-index for in-clock am/pm buttons

* Allow to reduce heavy animations

* Use global keydown event for calendar keyboard navigation

* Restyle highlighting of current dare

* Move calendar test to datepicker e2e

* Better styles for Year and Day :focus and :hover

* Fix linter

Co-authored-by: Olivier Tassinari <[email protected]>
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: menu This is the name of the generic UI component, not the React module! component: transitions This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! component: transitions This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

5 participants