Update form data whenever the address is set in any way
This commit is contained in:
parent
f00b32075a
commit
a86149b8d7
1 changed files with 3 additions and 6 deletions
|
|
@ -11,12 +11,6 @@ class AddressInput extends HTMLElement {
|
|||
|
||||
// Element references
|
||||
this._input = this.shadowRoot.querySelector("input");
|
||||
this._input.addEventListener("input", (event) => {
|
||||
let value = event.target.value;
|
||||
const entries = new FormData();
|
||||
entries.append("address", value);
|
||||
this.internals.setFormValue(entries);
|
||||
});
|
||||
this._suggestions = this.shadowRoot.querySelector(".suggestions-container");
|
||||
|
||||
// Bind methods
|
||||
|
|
@ -63,6 +57,9 @@ class AddressInput extends HTMLElement {
|
|||
set value(val) {
|
||||
if (this._input) {
|
||||
this._input.value = val;
|
||||
const entries = new FormData();
|
||||
entries.append("address", val);
|
||||
this.internals.setFormValue(entries);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue