mnfst 0.5.173 → 0.5.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/manifest.combobox.js
CHANGED
|
@@ -321,6 +321,21 @@ function initializeComboboxPlugin() {
|
|
|
321
321
|
// owns the listbox. readOptions keeps each row's innerHTML, preserving markup.
|
|
322
322
|
menu = document.createElement('menu');
|
|
323
323
|
menu.setAttribute('x-ignore', ''); // plugin-owned rows — Alpine must never walk them
|
|
324
|
+
// An authored <menu> source is the data layer; its presentation belongs to the
|
|
325
|
+
// rendered copy. Mirror the author's class and data-*/aria-* onto it — live, so
|
|
326
|
+
// bound values (:class, :aria-label="$x…") keep applying as state changes:
|
|
327
|
+
// Alpine writes the computed attribute onto the source, the observer relays it.
|
|
328
|
+
if (src && src.tagName === 'MENU') {
|
|
329
|
+
const carries = (n) => n === 'class' || (n.indexOf('data-') === 0 && n !== 'data-kbd') || (n.indexOf('aria-') === 0 && n !== 'aria-multiselectable');
|
|
330
|
+
const mirrorMenuAttrs = () => {
|
|
331
|
+
Array.from(menu.attributes).forEach(a => { if (carries(a.name) && !src.hasAttribute(a.name)) menu.removeAttribute(a.name); });
|
|
332
|
+
Array.from(src.attributes).forEach(a => { if (carries(a.name)) menu.setAttribute(a.name, a.value); });
|
|
333
|
+
};
|
|
334
|
+
mirrorMenuAttrs();
|
|
335
|
+
const menuAttrObserver = new MutationObserver(mirrorMenuAttrs);
|
|
336
|
+
menuAttrObserver.observe(src, { attributes: true });
|
|
337
|
+
if (cleanup) cleanup(() => menuAttrObserver.disconnect());
|
|
338
|
+
}
|
|
324
339
|
// Nearest popover host, so an outer auto popover isn't light-dismissed
|
|
325
340
|
// by listbox clicks; body otherwise (out of overflow contexts either way).
|
|
326
341
|
(el.closest('[popover]') || document.body).appendChild(menu);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"manifest.code.js": "sha384-G3MNfvQRWWY+gm4SGGrSsgQbDeil9MP+ON2DTk6Rcq9Nsex8woHMDt5EJHrFH0Nj",
|
|
8
8
|
"manifest.color.js": "sha384-6Rv3LxyTcZNjrhtayQfqRdCx0uSZ4BiEbgEI98I62eTvp8Aw7LBIoNJ0Je1oktwL",
|
|
9
9
|
"manifest.colorpicker.js": "sha384-N5ezEwgKrDodV4YdURxhdyZKmg1n/QhqvmAC4SEG03mw1pEAZAA8Gphp+NLAOxts",
|
|
10
|
-
"manifest.combobox.js": "sha384-
|
|
10
|
+
"manifest.combobox.js": "sha384-fE/SS0hPsSoCqn2x3H9u1HLY8dZ38PI/NCzrDpqL7+11QPOehG/f0f5MMGQqhBle",
|
|
11
11
|
"manifest.components.js": "sha384-eZDib+RFdwd9mOUdi6o53eNS0LBlEEkZPDegxtkAcE+GrGIFxsuB4O0ymfixGNfM",
|
|
12
12
|
"manifest.data.js": "sha384-3lLvGnqcQr4Ium80MdaQTr8RytjVbs5rnxd0q41BF3ppcoQccMFAcvgFSyZP/0sl",
|
|
13
13
|
"manifest.datepicker.js": "sha384-e6rJI0BxuE+AyI96/u6XoeOstsxLuQTO6+wYSr6rm2aKhOP2APM2xJqTz//0v4Pw",
|