Use editorfield instead of editor-field

This commit is contained in:
Henrik Giesel 2021-09-07 01:09:13 +02:00
parent c8c9c64ea5
commit ec9b43d3ab
2 changed files with 6 additions and 17 deletions

View file

@ -10,7 +10,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let dimensions: HTMLDivElement; let dimensions: HTMLDivElement;
let overflowFix = 0; let overflowFix = 0;
function updateOverflow(dimensions: HTMLDivElement) { function updateOverflow(dimensions: HTMLDivElement): void {
const boundingClientRect = dimensions.getBoundingClientRect(); const boundingClientRect = dimensions.getBoundingClientRect();
const overflow = isRtl const overflow = isRtl
? window.innerWidth - boundingClientRect.x - boundingClientRect.width ? window.innerWidth - boundingClientRect.x - boundingClientRect.width
@ -19,12 +19,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
overflowFix = Math.min(0, overflowFix + overflow, overflow); overflowFix = Math.min(0, overflowFix + overflow, overflow);
} }
function updateOverflowAsync(dimensions: HTMLDivElement) { afterUpdate(() => updateOverflow(dimensions));
function updateOverflowAsync(dimensions: HTMLDivElement): void {
setTimeout(() => updateOverflow(dimensions)); setTimeout(() => updateOverflow(dimensions));
} }
afterUpdate(() => updateOverflow(dimensions));
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
onMount(() => dispatch("mount")); onMount(() => dispatch("mount"));

View file

@ -16,8 +16,9 @@
margin: 3px 0; margin: 3px 0;
} }
.editor-field { .editorfield {
margin: 3px; margin: 3px;
border-radius: 5px; border-radius: 5px;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
@ -30,10 +31,6 @@
} }
} }
.editorfield {
margin: 0 2px;
}
/* editing-area */ /* editing-area */
.field { .field {
position: relative; position: relative;
@ -46,14 +43,6 @@
// (https://github.com/ankitects/anki/pull/1278) // (https://github.com/ankitects/anki/pull/1278)
background-image: linear-gradient(var(--flag1-bg), var(--flag1-bg)); background-image: linear-gradient(var(--flag1-bg), var(--flag1-bg));
} }
&:focus-within {
outline: 2px solid button-mixins.$focus-color;
}
&:focus {
outline: none;
}
} }
.fname { .fname {