File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ import AuthorCardEditing from 'components/AuthorCardEditing.vue'
5959import AuthorCardViewing from ' components/AuthorCardViewing.vue'
6060import { AuthorType } from ' src/types'
6161import { useCff } from ' src/store/cff'
62+ import { scrollToBottom } from ' ../scroll-to-bottom'
6263
6364export default defineComponent ({
6465 name: ' ScreenAuthors' ,
@@ -80,9 +81,6 @@ export default defineComponent({
8081 await nextTick ()
8182 scrollToBottom ()
8283 }
83- const scrollToBottom = () => {
84- document .getElementsByClassName (' bottom' )[0 ].scrollIntoView ({ behavior: ' smooth' })
85- }
8684 const removeAuthor = () => {
8785 const newAuthors = [... authors .value ]
8886 newAuthors .splice (editingId .value , 1 )
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ import IdentifierCardEditing from 'components/IdentifierCardEditing.vue'
6161import IdentifierCardViewing from ' components/IdentifierCardViewing.vue'
6262import { IdentifierType , IdentifierTypeType } from ' src/types'
6363import { useCff } from ' src/store/cff'
64+ import { scrollToBottom } from ' ../scroll-to-bottom'
6465
6566export default defineComponent ({
6667 name: ' ScreenIdentifiers' ,
@@ -92,9 +93,6 @@ export default defineComponent({
9293 setIdentifiers (newIdentifiers )
9394 editingId .value = - 1
9495 }
95- const scrollToBottom = () => {
96- document .getElementsByClassName (' bottom' )[0 ].scrollIntoView ({ behavior: ' smooth' })
97- }
9896 const setIdentifierDescriptionField = (field : keyof IdentifierType , value : string ) => {
9997 const identifier = { ... identifiers .value [editingId .value ] }
10098 identifier .description = value
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ import StepperActions from 'components/StepperActions.vue'
4949import Keyword from ' components/Keyword.vue'
5050import { defineComponent , nextTick } from ' vue'
5151import { useCff } from ' ../store/cff'
52+ import { scrollToBottom } from ' ../scroll-to-bottom'
5253
5354export default defineComponent ({
5455 name: ' ScreenKeywords' ,
@@ -59,9 +60,6 @@ export default defineComponent({
5960 },
6061 setup () {
6162 const { keywords, setKeywords } = useCff ()
62- const scrollToBottom = () => {
63- document .getElementsByClassName (' bottom' )[0 ].scrollIntoView ({ behavior: ' smooth' })
64- }
6563 const addKeyword = async () => {
6664 const newKeyword = ' '
6765 const newKeywords = [... keywords .value , newKeyword ]
Original file line number Diff line number Diff line change 1+ export const scrollToBottom = ( targetClass = 'bottom' ) => {
2+ document . getElementsByClassName ( targetClass ) [ 0 ] . scrollIntoView ( {
3+ behavior : 'smooth' ,
4+ block : 'end' ,
5+ inline : 'end'
6+ } )
7+ }
You can’t perform that action at this time.
0 commit comments