Posted 3 April 2024, 2:59 am EST - Updated 3 April 2024, 3:04 am EST
Hi,
I created a Popup to show some log entries.
The entries are rendered with a v-for statement.
If I show the popup alle the content is rendered but the popup is scrolled to the end.
How can I prevent this behavior?
<wj-popup ref="popupContent" style="width: 60%; max-height: 60vh; overflow-y: auto;" :modal="true" :initialized="initLogPopup" :shown="scrollTop">
<div>
<div class="wj-dialog-header">
Historie
</div>
<div class="wj-dialog-body" tabindex="-1">
<div v-if="currentLogEntries.length > 0">
<div v-for="log in currentLogEntries" :key="log.id" :class="{'error-log': log.type === 0}">
<p><strong>Datum und Uhrzeit:</strong> {{ formatDate(log.date) }}</p>
<p><strong>Nachricht:</strong> {{ log.message }}</p>
<hr>
</div>
</div>
<div v-else>
<p>Keine Log-Einträge vorhanden.</p>
</div>
</div>
<div class="wj-dialog-footer">
<button class="btn btn-primary wj-hide-ok">OK</button>
</div>
</div>
</wj-popup>
loadLog: function (id) {
wjcCore.httpRequest(
"./api/projects/getLog",
{
data: {
id: id
},
success: xhr => {
var resp = JSON.parse(xhr.responseText);
this.currentLogEntries = resp;
this.logPopup.show(true, (sender) => {
if (sender.dialogResult == 'wj-hide-ok') {
this.currentLogEntries = [];
};
});
}
}
)
},