mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Fix EditBox expansion and handling of Tab
key
This commit is contained in:
parent
d050e9aa64
commit
e95edadf62
@ -229,6 +229,7 @@ textarea::-webkit-scrollbar{
|
||||
.editor {
|
||||
max-width: calc(100% - 14px);
|
||||
min-height: 60px;
|
||||
max-height: 46vh;
|
||||
outline: 0px solid transparent;
|
||||
word-wrap: break-word;
|
||||
font-size: 16px;
|
||||
|
@ -112,9 +112,11 @@ const EditBox: Component<{
|
||||
|
||||
|
||||
if (elm.scrollHeight >= (maxHeight / 3)) {
|
||||
elm.style.height = '46vh';
|
||||
return;
|
||||
}
|
||||
|
||||
elm.style.height = 'auto';
|
||||
elm.rows = minRows;
|
||||
const rows = Math.ceil((elm.scrollHeight - elm._baseScrollHeight) / 20);
|
||||
elm.rows = minRows + rows;
|
||||
@ -146,7 +148,7 @@ const EditBox: Component<{
|
||||
return;
|
||||
}
|
||||
|
||||
const mentionSeparators = ['Enter', 'Space', 'Comma'];
|
||||
const mentionSeparators = ['Enter', 'Space', 'Comma', 'Tab'];
|
||||
|
||||
if (e.code === 'Enter' && e.metaKey) {
|
||||
e.preventDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user