assets/unpoly/unpoly.js in unpoly-rails-3.7.2 vs assets/unpoly/unpoly.js in unpoly-rails-3.7.3

- old
+ new

@@ -3,11 +3,11 @@ /* 0 */, /* 1 */ /***/ (() => { window.up = { - version: '3.7.2' + version: '3.7.3' }; /***/ }), /* 2 */ @@ -4053,10 +4053,11 @@ /***/ }), /* 45 */ /***/ (() => { +const u = up.util; const DESCENDANT_SELECTOR = /^([^ >+(]+) (.+)$/; up.FragmentFinder = class FragmentFinder { constructor(options) { this._options = options; this._origin = options.origin; @@ -4080,16 +4081,19 @@ } _findClosest() { return up.fragment.closest(this._origin, this._selector, this._options); } _findDescendantInRegion() { - let parts = this._selector.match(DESCENDANT_SELECTOR); - if (parts) { - let parent = up.fragment.closest(this._origin, parts[1], this._options); - if (parent) { - return up.fragment.getDumb(parent, parts[2]); + let simpleSelectors = up.fragment.splitTarget(this._selector); + return u.findResult(simpleSelectors, (simpleSelector) => { + let parts = simpleSelector.match(DESCENDANT_SELECTOR); + if (parts) { + let parent = up.fragment.closest(this._origin, parts[1], this._options); + if (parent) { + return up.fragment.getDumb(parent, parts[2]); + } } - } + }); } _findFirst() { return up.fragment.getDumb(this._document, this._selector, this._options); } }; \ No newline at end of file