forked from open-webui/open-webui
fix: feedback area scroll into view
This commit is contained in:
parent
d6a0805966
commit
68de49e533
2 changed files with 17 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
export let messageId = null;
|
||||||
export let show = false;
|
export let show = false;
|
||||||
export let message;
|
export let message;
|
||||||
|
|
||||||
|
@ -63,7 +64,10 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class=" my-2.5 rounded-xl px-4 py-3 border dark:border-gray-850">
|
<div
|
||||||
|
class=" my-2.5 rounded-xl px-4 py-3 border dark:border-gray-850"
|
||||||
|
id="message-feedback-{messageId}"
|
||||||
|
>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div class=" text-sm">{$i18n.t('Tell us more:')}</div>
|
<div class=" text-sm">{$i18n.t('Tell us more:')}</div>
|
||||||
|
|
||||||
|
|
|
@ -556,6 +556,12 @@
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
rateMessage(message.id, 1);
|
rateMessage(message.id, 1);
|
||||||
showRateComment = true;
|
showRateComment = true;
|
||||||
|
|
||||||
|
window.setTimeout(() => {
|
||||||
|
document
|
||||||
|
.getElementById(`message-feedback-${message.id}`)
|
||||||
|
?.scrollIntoView();
|
||||||
|
}, 0);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
@ -585,6 +591,11 @@
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
rateMessage(message.id, -1);
|
rateMessage(message.id, -1);
|
||||||
showRateComment = true;
|
showRateComment = true;
|
||||||
|
window.setTimeout(() => {
|
||||||
|
document
|
||||||
|
.getElementById(`message-feedback-${message.id}`)
|
||||||
|
?.scrollIntoView();
|
||||||
|
}, 0);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
@ -844,6 +855,7 @@
|
||||||
|
|
||||||
{#if showRateComment}
|
{#if showRateComment}
|
||||||
<RateComment
|
<RateComment
|
||||||
|
messageId={message.id}
|
||||||
bind:show={showRateComment}
|
bind:show={showRateComment}
|
||||||
bind:message
|
bind:message
|
||||||
on:submit={() => {
|
on:submit={() => {
|
||||||
|
|
Loading…
Reference in a new issue