TextBuffer: add keyboard scrolling support

This commit is contained in:
He4eT 2021-07-19 18:13:38 +05:00
commit 4ebbbd36fc
2 changed files with 11 additions and 9 deletions

View file

@ -82,6 +82,7 @@ export default function ({ inbox, currentWindow }) {
return ( return (
<section <section
tabindex='0'
ref={textBufferEl} ref={textBufferEl}
className={classes}> className={classes}>
{messages.map(TextMessage)} {messages.map(TextMessage)}

View file

@ -44,7 +44,7 @@
border: var(--border-width) solid var(--main-color); border: var(--border-width) solid var(--main-color);
} }
.ifplayer .buffer { .ifplayer .output .buffer {
overflow-y: scroll; overflow-y: scroll;
box-sizing: border-box; box-sizing: border-box;
@ -54,32 +54,33 @@
scrollbar-width: thin; scrollbar-width: thin;
} }
.ifplayer .buffer:empty { .ifplayer .output .buffer:empty {
display: none; display: none;
} }
.ifplayer .buffer::-webkit-scrollbar { .ifplayer .output .buffer::-webkit-scrollbar {
width: 8px; width: 8px;
} }
.ifplayer .buffer::-webkit-scrollbar-thumb { .ifplayer .output .buffer::-webkit-scrollbar-thumb {
background-color: var(--main-color); background-color: var(--main-color);
border: 4px solid var(--bg-color); border: 4px solid var(--bg-color);
border-left-width: 0px; border-left-width: 0px;
} }
.ifplayer .gridBuffer { .ifplayer .output .gridBuffer {
flex-shrink: 0; flex-shrink: 0;
border-bottom: var(--border-width) solid var(--main-color); border-bottom: var(--border-width) solid var(--main-color);
} }
.ifplayer .textBuffer { .ifplayer .output .textBuffer {
flex: 2 1; flex: 2 1;
outline: none;
} }
.ifplayer .textBuffer > br:first-child, .ifplayer .output .textBuffer > br:first-child,
.ifplayer .textBuffer > br:last-child, .ifplayer .output .textBuffer > br:last-child,
.ifplayer .textBuffer > br + br + br { .ifplayer .output .textBuffer > br + br + br {
display: none; display: none;
} }