Closed alvincrespo closed 10 years ago
hey @alvincrespo , I just bumped into that issue.
In my case, handleTabIntoBrowser
is the one trying to give the focus to a destroyed component ( https://github.com/instructure/ic-modal/blob/master/lib/modal.js#L18-L21 ). So we need to check the state of the component, or to make sure that lastOpenedModal
is null
, or to make sure that handleTabIntoBrowser
doesn't get call (or something else that I haven't figured yet!).
I'm trying now to have a better understanding of the problem/code.
(and I'm on version 0.0.6)
Adding this code to the component
willDestroyElement: function() {
if( lastOpenedModal === this ) {
lastOpenedModal = null;
}
},
is obviously enough to get rid of the exception.
When trying to write acceptance tests, I'm getting the following error:
Error
Implementation
Test
Here is what I've noticed:
destroying
is the state whenclick('.leave-activity:first-of-type');
is executedthis.get('element')
is undefined when thefocus
event is taking placeI'm curious if we should be disabling the focus event when the component is being destroyed?