Closed sarus closed 8 years ago
Ahh, I think I know what's going on here. The target isn't being detected, possibly due to it not being in the DOM. I'll see what I can do.
If you can come up with a reproduction, that would help a lot :)
Playing around with it more I'm actually getting the same error when clicking on other drop down buttons in subroutes even when there is no route transition. These are definitely new to Ember 2.7 so not sure if some behavior might have changed there. The position of the drop down in the sub routes is also off (pop-over appears in the wrong location).
Will keep trying to narrow it down a bit.
All the errors do seem to be related to a missing element:
Uncaught Error: Cannot get styles on an element that doesn't existget
Styles @ dom-ruler.amd.js:174
detectBoxSizing @ dom-ruler.amd.js:230
getLayout @ dom-ruler.amd.js:76
Rectangle.ofElement @ rectangle.js:71
tile @ component.js:267
invokeWithOnError @ ember.debug.js:999
flush @ ember.debug.js:1054
flush @ ember.debug.js:862
end @ ember.debug.js:176
run @ ember.debug.js:289
join @ ember.debug.js:318
run.join @ ember.debug.js:24337
(anonymous function) @ ember.debug.js:24400
dispatch @ jquery.js:4737
elemData.handle @ jquery.js:4549
Thanks for this!
Hi Tim,
Trying to get a stripped down example of this occurring. The subroute issue appears to be a false alarm. That was related to another problem that Ember 2.7 uncovered that I was able to resolve. Still looking into the route transition issue. Will report back here.
Oh geeze,
I found the problem. I had an element id duplicated in one of my templates. The button that the drop down was supposed to trigger off of was not loaded into that route thus causing the element not found issues.
Sorry for the mass confusion on my part!
Haha, no problem! That's definitely confusing. Would you be keen on pushing up a PR that assert
s that there's no duplicates?
That's a good idea. I'll add an assert for duplicates as well as an assert for the element not existing on the page.
Yay!
I started getting this error after updating to Ember v0.2.7 (it's possible the error is unrelated to the upgrade).
Here is the stack trace:
The error occurs in target.js in this function
Somehow
target
is null which causes the issue. The error only occurs when transitioning between routes. So for example, if I load Route A, then click on a link to go to Route B, the error will occur. If I just load Route B directly (e.g., with a page refresh) there is no error.I'm wondering if a null check on target is a valid fix for this?