Skip to content

Commit

Permalink
Do not consider forms for phx-value Closes #2682, Closes #2680
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismccord committed Jun 12, 2023
1 parent 460b6f9 commit 9f3c8d8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/js/phoenix_live_view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ export default class View {
let name = el.attributes[i].name
if(name.startsWith(prefix)){ meta[name.replace(prefix, "")] = el.getAttribute(name) }
}
if(el.value !== undefined){
if(el.value !== undefined && !(el instanceof HTMLFormElement)){
if(!meta){ meta = {} }
meta.value = el.value

Expand Down
2 changes: 1 addition & 1 deletion priv/static/phoenix_live_view.cjs.js

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

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion priv/static/phoenix_live_view.esm.js

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

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion priv/static/phoenix_live_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3364,7 +3364,7 @@ within:
meta[name.replace(prefix, "")] = el.getAttribute(name);
}
}
if (el.value !== void 0) {
if (el.value !== void 0 && !(el instanceof HTMLFormElement)) {
if (!meta) {
meta = {};
}
Expand Down
2 changes: 1 addition & 1 deletion priv/static/phoenix_live_view.min.js

Large diffs are not rendered by default.

0 comments on commit 9f3c8d8

Please sign in to comment.