mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Convert the whole request to json at once on select widget
This commit is contained in:
@ -165,9 +165,8 @@ export abstract class AjaxSelect extends AutoCompleteSelectBase {
|
||||
|
||||
connectedCallback() {
|
||||
/* Capture initial values before they get moved to the inner node and overridden by tom-select */
|
||||
this.initialValues = Array.from(this.children)
|
||||
.filter((child: Element) => child.tagName.toLowerCase() === "slot")
|
||||
.map((slot) => JSON.parse(slot.innerHTML));
|
||||
const initial = this.querySelector("slot[name='initial']")?.textContent;
|
||||
this.initialValues = initial ? JSON.parse(initial) : [];
|
||||
|
||||
super.connectedCallback();
|
||||
}
|
||||
|
Reference in New Issue
Block a user