Skip to content

Commit bd30c08

Browse files
carlosescriclaude
andcommitted
fix: apply prettier formatting and rebuild assets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 79cf65d commit bd30c08

7 files changed

Lines changed: 76 additions & 11 deletions

File tree

assets/js/phoenix_live_view/dom.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,9 @@ const DOM = {
706706
isFormAssociatedCustomElement(el: Element | EventTarget | null): boolean {
707707
if (!(el instanceof HTMLElement) || !el.localName) return false;
708708
const ctor = customElements.get(el.localName);
709-
return !!ctor && (ctor as { formAssociated?: boolean }).formAssociated === true;
709+
return (
710+
!!ctor && (ctor as { formAssociated?: boolean }).formAssociated === true
711+
);
710712
},
711713

712714
syncAttrsToProps(el) {

priv/static/phoenix_live_view.cjs.js

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix_live_view.cjs.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix_live_view.esm.js

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix_live_view.esm.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

priv/static/phoenix_live_view.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,19 @@ var LiveView = (() => {
891891
}
892892
return el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement || el instanceof HTMLButtonElement;
893893
},
894+
/**
895+
* Returns true if the element is a Form-Associated Custom Element (FACE).
896+
* Unlike native inputs, FACEs store their value in ElementInternals (via
897+
* setFormValue), not in DOM attributes or children. Their light-DOM
898+
* children and slotted elements must be patched normally by morphdom even
899+
* while the element has focus.
900+
*/
901+
isFormAssociatedCustomElement(el) {
902+
if (!(el instanceof HTMLElement) || !el.localName)
903+
return false;
904+
const ctor = customElements.get(el.localName);
905+
return !!ctor && ctor.formAssociated === true;
906+
},
894907
syncAttrsToProps(el) {
895908
if (el instanceof HTMLInputElement && CHECKABLE_INPUTS.indexOf(el.type.toLocaleLowerCase()) >= 0) {
896909
el.checked = el.getAttribute("checked") !== null;
@@ -2602,6 +2615,14 @@ removing illegal node: "${("outerHTML" in childNode && childNode.outerHTML || ch
26022615
return false;
26032616
}
26042617
if (isFocusedFormEl && fromEl.type !== "hidden" && !focusedSelectChanged) {
2618+
if (dom_default.isFormAssociatedCustomElement(fromEl)) {
2619+
this.trackBeforeUpdated(fromEl, toEl);
2620+
dom_default.mergeAttrs(fromEl, toEl);
2621+
dom_default.syncAttrsToProps(fromEl);
2622+
updates.push(fromEl);
2623+
dom_default.applyStickyOperations(fromEl);
2624+
return fromEl;
2625+
}
26052626
this.trackBeforeUpdated(fromEl, toEl);
26062627
dom_default.mergeFocusedInput(fromEl, toEl);
26072628
dom_default.syncAttrsToProps(fromEl);

priv/static/phoenix_live_view.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)