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 overflowFix = 0;
function updateOverflow(dimensions: HTMLDivElement) {
function updateOverflow(dimensions: HTMLDivElement): void {
const boundingClientRect = dimensions.getBoundingClientRect();
const overflow = isRtl
? 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);
}
function updateOverflowAsync(dimensions: HTMLDivElement) {
afterUpdate(() => updateOverflow(dimensions));
function updateOverflowAsync(dimensions: HTMLDivElement): void {
setTimeout(() => updateOverflow(dimensions));
}
afterUpdate(() => updateOverflow(dimensions));
const dispatch = createEventDispatcher();
onMount(() => dispatch("mount"));

View file

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