-
Notifications
You must be signed in to change notification settings - Fork 98
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
resize notifications are broken #115
Comments
Got it! Did some codebase digging.
The former has the advantage that it avoids tree walking as it doesn't require a descendancy check. The latter has the advantage that it doesn't complicate I hope that this can be resolved. The need to manually implement the Additional problem: |
Thanks for the suggestion and the contribution. I will take a look! |
@cdata Thanks for the quick response! I found some old open issues with the term "resize" from June. So, I was a bit worried :) Could you add the bug label as well? (My users won't know which tab is selected => bug)
What do you think? |
Sorry, I misread. You are correct that this is a bug. I think the implementation is just weird and needs to be fixed. I believe there is another issue open that talked about a similar problem. |
I'm facing the same issue, but with an iron-list in the hidden page. See the link below: |
Maybe the easiest solution would be replacing
with
|
Good idea. I didn't know that this method even exists :) Quick thought: Can we be sure that it will work properly with the shadow DOM? I think that it won't necessarily because the method probably only considers children in the light DOM. BTW Additionally I'd say that it should check both the current selected page and while it's animating out the previous selected page as well. Otherwise resizing the window during the animation will cause visible problems if the animation is slow. I'd code it like this ( |
Hey @MajorBreakfast and @omarbelkhodja. Were either of you able to evaluate how well the above proposed workaround handles in your current apps using native Shadow DOM? I can't see immediate negative repercussions to the approach proposed, but am interested in how well this change would work outside our demos. It's definitely a bug.
I'm personally in favor of this. Does anyone want to submit an updated patch and we'll give it some further testing? 🚗 |
I'll have a look this weekend. |
I have been using the fix "return selectedPage ? selectedPage.contains(element) : false" for many weeks now, and that fixed my problem. The exact file modified I'm using is https://github.com/omarbelkhodja/neon-animation/blob/master/neon-animated-pages.html. I'm not checking the previous selected page. window.Polymer = window.Polymer || {};
window.Polymer.dom = 'shadow'; The behaviour is still the same : the problem is fixed. I have also verified in the Developer Tools that shadow DOM is really enabled. Now, looking at https://www.w3.org/TR/domcore/#dom-node-contains, I'm not sure whether elements in the shadow DOM are checked by this API or not. It means that on Chrome, it is OK now, but it is not said that the API will still have the same beviour later, if the current behaviour is judged to be a bug. |
@omarbelkhodja Here is a quick jsfiddle. Both chrome and firefox ( |
@MajorBreakfast Yes, right ! I've checked your code and what you say is true. But the thing is that my problem is solved with that piece of code... Looking further, I think we don't really want to notify the elements within the shadow DOM. The elements that need to be notified about the resize event are the elements that are inside the content of the page. They are not elements that are inside the shadow dom of one page. Each element should be in charge of forwarding or not the event inside its shadow DOM. What do you think about that ? |
@omarbelkhodja Take as an example a site that has tabs in its menu bar. Assume the menu bar is a webcomponent and has the tabs in its shadow DOM. Resize notifications must cross the shadow boundary for the tabs to work properly (jsfiddle). |
My
<paper-tabs>
element draws it's selection bar incorrectly if I use it as a descendant of a<neon-animated-pages>
element on an initially hidden page.The culprit is this line. It's an optimization, but it's broken and I can't figure out what goes wrong. Can you remove it? (Or even better - fix it :)
The text was updated successfully, but these errors were encountered: