[IMP] mail: allow scroll using keyboard key in chat window

Before this PR, it was not possible to scroll a chat window using page down/page
up, home or end keys.
This is because the thread component that is scrollable cannot became an activeElement.
This PR fix this by adding a tabindex="-1" on the scrollable element.

Task-3468978

closes odoo/odoo#134657

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This commit is contained in:
Didier (did)
2023-09-07 14:45:28 +00:00
parent 5bfe32d939
commit 8bd1d87880
2 changed files with 4 additions and 1 deletions
@@ -1,3 +1,6 @@
.o-mail-Thread:focus-visible {
outline: 0;
}
.o-mail-Thread-newMessage {
transition: opacity 0.5s;
@@ -3,7 +3,7 @@
<t t-name="mail.Thread">
<t t-if="env.inChatter" t-call="mail.Thread.jumpPresent"/> <!-- chatter has its own scrollable, this ensures proper sticky showing -->
<div class="o-mail-Thread position-relative flex-grow-1 d-flex flex-column" t-att-class="{ 'overflow-auto': props.hasScrollAdjust, 'pb-4': !state.showJumpPresent }" t-ref="messages">
<div class="o-mail-Thread position-relative flex-grow-1 d-flex flex-column" t-att-class="{ 'overflow-auto': props.hasScrollAdjust, 'pb-4': !state.showJumpPresent }" t-ref="messages" tabindex="-1">
<t t-if="!props.thread.isEmpty or props.thread.loadOlder or props.thread.hasLoadingFailed" name="content">
<div class="d-flex flex-column position-relative flex-grow-1" t-att-class="{'justify-content-end': !env.inChatter and props.thread.type !== 'mailbox'}">
<span class="position-absolute w-100 invisible" t-att-class="props.order === 'asc' ? 'bottom-0' : 'top-0'" t-ref="present-treshold" t-att-style="`height: Min(${PRESENT_THRESHOLD}px, 100%)`"/>