ciampo/swiper-behavior

Pagination bullets cannot be styled

Closed this issue · 1 comments

Swiper adds the pagination buttons dynamically, as they aren't added the Polymer way, they don't get the relevant classes added by the shady dom.

Can be resolved by adding the following to the attached lifecycle event:

this.async(function() {
   this.swiper.on('onPaginationRendered', function() {
   Polymer.dom(this.$.pagination)
       .querySelectorAll('.swiper-pagination-bullet')
       .forEach(function(bullet) {
         Polymer.dom(bullet).classList.add(this.is);
        }.bind(this));
   }.bind(this));
 });

Hi Will,

thanks for firing the issue. I just pushed an update, where I'm using the scopeSubtree function to keep the pagination's local DOM up to date with Polymer.

Let me know if you still encounter this problem in the new version of the behavior