nolimits4web / dom7

Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
http://framework7.io/docs/dom7.html
MIT License
162 stars 45 forks source link

enhancement - children of a slot element #44

Open gullerya opened 3 years ago

gullerya commented 3 years ago

I've came to this lib from the swiper one, thanks for both!!!

I'm attempting to use swiper in a custom element, while leaving to the consumer to provide the slides as slotted elements from the light DOM, for example to be able to style them.

swiper as of now doesn't play well with this, seemingly due to this line here:

const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);

Since this method children belongs to dom7, I'm writing here :)

If the children method would be re-written in a following fashion (meta code), I think that would give us a correct behaviour:

if this is slot and assigned elements not empty {
  extract from assigned elements
} else {
  extract from children
}

WDYT?