PolymerElements / paper-scroll-header-panel

Fancy scrolling effects where the header animates between tall and condensed states
24 stars 29 forks source link

inconsistent event "content-scroll" #97

Open alfalabs opened 8 years ago

alfalabs commented 8 years ago

Description

<paper-header-panel> and <paper-scroll-header-panel> share event named content-scroll In supplied example, this event fires while using <paper-scroll-header-panel> but not with <paper-header-panel> The problem is not with event not firing in <paper-header-panel> (there is another way to get this event) but the need to write different code for each header-panel.

Also filed under: https://github.com/PolymerElements/paper-header-panel/issues/83

Expected outcome

Events named with the same name should have consistent behavior. The web components inside these panels should have the same code to handle scrolling - to be reusable in both.

Actual outcome

Different code has to be written for each panel type.

Live Demo

example with paper-scroll-header-panel - event is firing - please see console. https://jsbin.com/yigeciyomo/edit?html,console,output

example with paper-header-panel - event not firing - please see console for lack of message. https://jsbin.com/miyuluxojo/edit?html,console,output

blasten commented 8 years ago

That was certainly a mistake in paper-scroll-header-panel. content-scroll should not bubble in first place. Also since we released app-layout, we decided to move away from this pattern. We changed the structure a little bit for the elements, so the element doesn't need to fire an event like this. Feel free to send a PR to fix this issue.

tcuje commented 8 years ago

Any news on this? 'content-scroll' is never fired in my case, only thing working is adding an event listener directly to the scroller, like: ".scroller.addEventListener('scroll', function (event) { console.log("triggering"); });"