Skip to content

Commit f0f0845

Browse files
committed
undo select change
When working on #4227 I noticed that the code set readOnly for selects, but selects don't have a readOnly property. I changed the code to disable them instead. Since I'm not fully convinced that this does not negatively affect form submissions in some circumstances, I'm reverting that change for now. (disabled form elements are not part of a form payload)
1 parent 5665ea2 commit f0f0845

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

assets/js/phoenix_live_view/view.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,14 +1958,10 @@ export default class View {
19581958
const filterInput = (el): el is HTMLInputElement | HTMLTextAreaElement =>
19591959
["INPUT", "TEXTAREA"].includes(el.tagName);
19601960

1961-
const filterSelects = (el): el is HTMLSelectElement =>
1962-
el.tagName === "SELECT";
1963-
19641961
const formElements = Array.from(formEl.elements);
19651962
const disables = formElements.filter(filterDisables);
19661963
const buttons = formElements.filter(filterButton).filter(filterIgnored);
19671964
const inputs = formElements.filter(filterInput).filter(filterIgnored);
1968-
const selects = formElements.filter(filterSelects).filter(filterIgnored);
19691965

19701966
buttons.forEach((button) => {
19711967
button.setAttribute(PHX_DISABLED, button.disabled.toString());
@@ -1979,14 +1975,9 @@ export default class View {
19791975
input.disabled = true;
19801976
}
19811977
});
1982-
selects.forEach((select) => {
1983-
select.setAttribute(PHX_DISABLED, select.disabled.toString());
1984-
select.disabled = true;
1985-
});
19861978
const formEls = disables
19871979
.concat(buttons)
19881980
.concat(inputs)
1989-
.concat(selects)
19901981
.map((el) => {
19911982
return { el, loading: true, lock: true };
19921983
});

0 commit comments

Comments
 (0)