Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nolimits4web/swiper
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Jul 24, 2024
2 parents 43a1bde + 0239e7f commit de03603
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

# [11.1.7](https://github.com/nolimits4web/Swiper/compare/v11.1.6...v11.1.7) (2024-07-24)

### Bug Fixes

- **core:** fix element child detection ([7ec975c](https://github.com/nolimits4web/Swiper/commit/7ec975c8550bfebacc7ecd032dc540e720f45175)), closes [#7636](https://github.com/nolimits4web/Swiper/issues/7636)

# [11.1.6](https://github.com/nolimits4web/Swiper/compare/v11.1.5...v11.1.6) (2024-07-23)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swiper-src",
"version": "11.1.6",
"version": "11.1.7",
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"type": "module",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/copy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swiper",
"version": "11.1.6",
"version": "11.1.7",
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"typings": "swiper.d.ts",
"type": "module",
Expand Down Expand Up @@ -208,5 +208,5 @@
"engines": {
"node": ">= 4.7.0"
},
"releaseDate": "July 23, 2024"
"releaseDate": "July 24, 2024"
}
14 changes: 9 additions & 5 deletions src/shared/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,22 @@ function findElementsInElements(elements = [], selector = '') {
}
function elementChildren(element, selector = '') {
const children = [...element.children];
if(element instanceof HTMLSlotElement) {
children.push(...element.assignedElements())
if (element instanceof HTMLSlotElement) {
children.push(...element.assignedElements());
}

if(!selector) {
if (!selector) {
return children;
}
return children.filter((el) => el.matches(selector));
}
function elementIsChildOf(el, parent) {
const children = elementChildren(parent);
return children.includes(el);
const isChild = parent.contains(el);
if (!isChild && parent instanceof HTMLSlotElement) {
const children = [...element.assignedElements()];
return children.includes(el);
}
return isChild;
}
function showWarning(text) {
try {
Expand Down

0 comments on commit de03603

Please sign in to comment.