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 { ...@@ -236,7 +236,7 @@ class DataSet extends CustomElement {
[assembleMethodSymbol]() { [assembleMethodSymbol]() {
super[assembleMethodSymbol](); super[assembleMethodSymbol]();
requestAnimationFrame(() => { setTimeout(() => {
if (!this[datasourceLinkedElementSymbol]) { if (!this[datasourceLinkedElementSymbol]) {
const selector = this.getOption("datasource.selector"); const selector = this.getOption("datasource.selector");
...@@ -278,7 +278,7 @@ class DataSet extends CustomElement { ...@@ -278,7 +278,7 @@ class DataSet extends CustomElement {
} }
initEventHandler.call(this); initEventHandler.call(this);
}); },10);
} }
/** /**
......
...@@ -414,7 +414,7 @@ class DataTable extends CustomElement { ...@@ -414,7 +414,7 @@ class DataTable extends CustomElement {
this[datasourceLinkedElementSymbol] = element; this[datasourceLinkedElementSymbol] = element;
getWindow().requestAnimationFrame(() => { queueMicrotask(() => {
handleDataSourceChanges.call(this); handleDataSourceChanges.call(this);
if (element && "datasource" in element) { if (element && "datasource" in element) {
element.datasource.attachObserver( element.datasource.attachObserver(
......
...@@ -547,11 +547,9 @@ function updateFilterSelections() { ...@@ -547,11 +547,9 @@ function updateFilterSelections() {
this[filterSelectElementSymbol].setOption("options", options); this[filterSelectElementSymbol].setOption("options", options);
setTimeout(() => { setTimeout(() => {
window.requestAnimationFrame(() => {
this[filterSelectElementSymbol].value = this[filterSelectElementSymbol].value =
this[settingsSymbol].getSelected(); this[settingsSymbol].getSelected();
}); }, 10);
}, 0);
}); });
} }
......
...@@ -516,7 +516,7 @@ function handleDataSourceChanges() { ...@@ -516,7 +516,7 @@ function handleDataSourceChanges() {
pagination.items = []; pagination.items = [];
} }
getWindow().requestAnimationFrame(() => { queueMicrotask(() => {
this.setOption("pagination", pagination); this.setOption("pagination", pagination);
}); });
} }
......
...@@ -324,7 +324,8 @@ class CustomControl extends CustomElement { ...@@ -324,7 +324,8 @@ class CustomControl extends CustomElement {
* @param {string} state * @param {string} state
* @param {string} mode * @param {string} mode
*/ */
formStateRestoreCallback(state, mode) {} formStateRestoreCallback(state, mode) {
}
/** /**
* *
...@@ -378,14 +379,15 @@ function initValueAttributeObserver() { ...@@ -378,14 +379,15 @@ function initValueAttributeObserver() {
} }
self[debounceValueSymbol] = new DeadMansSwitch(50, () => { self[debounceValueSymbol] = new DeadMansSwitch(50, () => {
requestAnimationFrame(() => {
const oldValue = self.getAttribute("value"); const oldValue = self.getAttribute("value");
const newValue = self.getOption("value"); const newValue = self.getOption("value");
if (oldValue !== newValue) { if (oldValue !== newValue) {
queueMicrotask(() => {
this.setOption("value", this.getAttribute("value")); 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