fix select-boxes submit their old value, if they are onchange="1"

@Nathan: Not sure if this is the right fix, but I can't see where we use Lit's FormatMixing, which defines serializedValue (and therefore select-box always returns the old modalValue)
This commit is contained in:
ralf 2022-02-21 20:58:56 +02:00
parent d23c8cbcb4
commit c2166c5750
4 changed files with 4 additions and 32 deletions

View File

@ -250,16 +250,6 @@ export class Et2DateDuration extends Et2InputWidget(LitElement)
this.formatter = formatDuration; this.formatter = formatDuration;
} }
getValue()
{
if(this.readOnly)
{
return null;
}
return this.value;
}
get value() : string get value() : string
{ {
let value = 0; let value = 0;
@ -543,4 +533,4 @@ export class Et2DateDuration extends Et2InputWidget(LitElement)
} }
// @ts-ignore TypeScript is not recognizing that this is a LitElement // @ts-ignore TypeScript is not recognizing that this is a LitElement
customElements.define("et2-date-duration", Et2DateDuration); customElements.define("et2-date-duration", Et2DateDuration);

View File

@ -126,11 +126,7 @@ const Et2InputWidgetMixin = (superclass) =>
getValue() getValue()
{ {
if(this.readOnly) return this.readOnly ? null : this.value;
{
return null;
}
return this.serializedValue !== "undefined" ? this.serializedValue : this.modalValue;
} }

View File

@ -75,11 +75,6 @@ export class Et2WidgetWithSelect extends Et2InputWidget(LionSelect)
} }
} }
getValue()
{
return this.readOnly ? null : this.modalValue;
}
set_value(val) set_value(val)
{ {
let oldValue = this.modalValue; let oldValue = this.modalValue;
@ -635,4 +630,4 @@ export class Et2SelectYear extends Et2Select
} }
// @ts-ignore TypeScript is not recognizing that this widget is a LitElement // @ts-ignore TypeScript is not recognizing that this widget is a LitElement
customElements.define("et2-select-year", Et2SelectYear); customElements.define("et2-select-year", Et2SelectYear);

View File

@ -45,16 +45,7 @@ export class Et2Textbox extends Et2InputWidget(LionInput)
{ {
super.connectedCallback(); super.connectedCallback();
} }
getValue()
{
if(this.readOnly)
{
return null;
}
return this.value;
}
} }
// @ts-ignore TypeScript is not recognizing that Et2Textbox is a LitElement // @ts-ignore TypeScript is not recognizing that Et2Textbox is a LitElement
customElements.define("et2-textbox", Et2Textbox); customElements.define("et2-textbox", Et2Textbox);