Removed overflow in the TextEditor. Panel fix. (#3840)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2023-10-16 08:08:31 +03:00 committed by GitHub
parent 945f295336
commit d5d98f64e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 11 deletions

View File

@ -65,15 +65,15 @@
const startScrollHeightCheck = () => { const startScrollHeightCheck = () => {
clearTimeout(timer) clearTimeout(timer)
timer = setTimeout(() => { timer = setTimeout(() => {
if (scroll == null) { if (content == null) {
return return
} }
if (content !== undefined && lastScrollHeight <= content?.scrollHeight && count <= waitCount) { if (lastScrollHeight <= content?.scrollHeight && count <= waitCount) {
count = lastScrollHeight < content.scrollHeight ? 0 : count + 1 count = lastScrollHeight < content.scrollHeight ? 0 : count + 1
lastScrollHeight = content.scrollHeight lastScrollHeight = content.scrollHeight
startScrollHeightCheck() startScrollHeightCheck()
} else if (content !== undefined) { } else {
lastScrollHeight = -1 lastScrollHeight = -1
count = 0 count = 0

View File

@ -64,7 +64,7 @@
export let field: string | undefined = undefined export let field: string | undefined = undefined
export let autoOverflow = false export let overflow: 'auto' | 'none' = 'auto'
export let initialContent: string | undefined = undefined export let initialContent: string | undefined = undefined
export let textNodeActions: TextNodeAction[] = [] export let textNodeActions: TextNodeAction[] = []
export let editorAttributes: { [name: string]: string } = {} export let editorAttributes: { [name: string]: string } = {}
@ -347,7 +347,7 @@
{#if visible} {#if visible}
{#if comparedVersion !== undefined || $$slots.tools} {#if comparedVersion !== undefined || $$slots.tools}
<div class="ref-container" class:autoOverflow> <div class="ref-container" style:overflow>
{#if comparedVersion !== undefined} {#if comparedVersion !== undefined}
<div class="flex-row-center buttons-group xsmall-gap"> <div class="flex-row-center buttons-group xsmall-gap">
<StyleButton <StyleButton
@ -394,7 +394,7 @@
/> />
</div> </div>
<div class="ref-container" class:autoOverflow> <div class="ref-container" style:overflow>
<div class="text-input" class:focusable> <div class="text-input" class:focusable>
<div class="select-text" style="width: 100%;" bind:this={element} /> <div class="select-text" style="width: 100%;" bind:this={element} />
</div> </div>
@ -402,10 +402,6 @@
{/if} {/if}
<style lang="scss"> <style lang="scss">
.autoOverflow {
overflow: auto;
}
.ref-container .formatPanel { .ref-container .formatPanel {
margin: -0.5rem -0.25rem 0.5rem; margin: -0.5rem -0.25rem 0.5rem;
padding: 0.375rem; padding: 0.375rem;

View File

@ -8,7 +8,7 @@
} }
.text-editor-view { .text-editor-view {
overflow-y: auto; // overflow-y: auto;
color: var(--theme-text-primary-color); color: var(--theme-text-primary-color);
.title, .title,