Skip to content
Snippets Groups Projects
Verified Commit 819528c0 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: remove request frame as it causes problems (performance) #290

parent 3a225f91
No related branches found
No related tags found
No related merge requests found
......@@ -236,7 +236,7 @@ class DataSet extends CustomElement {
[assembleMethodSymbol]() {
super[assembleMethodSymbol]();
requestAnimationFrame(() => {
setTimeout(() => {
if (!this[datasourceLinkedElementSymbol]) {
const selector = this.getOption("datasource.selector");
......@@ -278,7 +278,7 @@ class DataSet extends CustomElement {
}
initEventHandler.call(this);
});
},10);
}
/**
......
......@@ -414,7 +414,7 @@ class DataTable extends CustomElement {
this[datasourceLinkedElementSymbol] = element;
getWindow().requestAnimationFrame(() => {
queueMicrotask(() => {
handleDataSourceChanges.call(this);
if (element && "datasource" in element) {
element.datasource.attachObserver(
......
......@@ -547,11 +547,9 @@ function updateFilterSelections() {
this[filterSelectElementSymbol].setOption("options", options);
setTimeout(() => {
window.requestAnimationFrame(() => {
this[filterSelectElementSymbol].value =
this[settingsSymbol].getSelected();
});
}, 0);
}, 10);
});
}
......
......@@ -516,7 +516,7 @@ function handleDataSourceChanges() {
pagination.items = [];
}
getWindow().requestAnimationFrame(() => {
queueMicrotask(() => {
this.setOption("pagination", pagination);
});
}
......
......@@ -324,7 +324,8 @@ class CustomControl extends CustomElement {
* @param {string} state
* @param {string} mode
*/
formStateRestoreCallback(state, mode) {}
formStateRestoreCallback(state, mode) {
}
/**
*
......@@ -378,14 +379,15 @@ function initValueAttributeObserver() {
}
self[debounceValueSymbol] = new DeadMansSwitch(50, () => {
requestAnimationFrame(() => {
const oldValue = self.getAttribute("value");
const newValue = self.getOption("value");
if (oldValue !== newValue) {
queueMicrotask(() => {
this.setOption("value", this.getAttribute("value"));
}
});
}
});
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment