Ported Firefish's note focus behavior

This commit is contained in:
Volpeon 2024-01-03 13:52:46 +01:00
parent 32f60f9969
commit 43b3b5a34b
No known key found for this signature in database
2 changed files with 65 additions and 5 deletions

View file

@ -776,6 +776,10 @@ function focusAfter() {
focusNext(el.value);
}
function scrollIntoView() {
el.value.scrollIntoView();
}
function readPromo() {
os.api('promo/read', {
noteId: appearNote.value.id,
@ -790,6 +794,12 @@ function emitUpdReaction(emoji: string, delta: number) {
emit('reaction', emoji);
}
}
defineExpose({
focus,
blur,
scrollIntoView,
});
</script>
<style lang="scss" module>
@ -824,7 +834,7 @@ function emitUpdReaction(emoji: string, delta: number) {
margin: auto;
width: calc(100% - 8px);
height: calc(100% - 8px);
border: dashed 1px var(--focus);
border: solid 1px var(--focus);
border-radius: var(--radius);
box-sizing: border-box;
}