feat(renderer): add delay in caption update to ensure correct timing for UiControlEvent

This commit is contained in:
extio-de
2026-02-24 21:52:48 +01:00
parent b30554332c
commit 69f07babe1

View File

@@ -71,6 +71,11 @@ public class G2DMultiLineTextAreaControlImpl extends G2DBaseControlImpl implemen
this.textArea = new CustomMultiLineTextArea(this.rendererData.getThemeManager(), text -> { this.textArea = new CustomMultiLineTextArea(this.rendererData.getThemeManager(), text -> {
this.lastText = text; this.lastText = text;
this.lastCaptionUpdateTimeInternal = System.currentTimeMillis(); this.lastCaptionUpdateTimeInternal = System.currentTimeMillis();
try {
Thread.sleep(2); // Ensure that the next caption update time (e.g. reacting on UiControlEvent) is always after the last caption update time internal to trigger the caption update in the render method
}
catch (final InterruptedException e) {
}
this.rendererData.getEventService().fire(new UiControlEvent(this.id, text)); this.rendererData.getEventService().fire(new UiControlEvent(this.id, text));
}); });