fix: broken scroll to definition in graphql documentation
This commit is contained in:
@@ -410,12 +410,25 @@ const handleJumpToType = async (type: GraphQLType) => {
|
|||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
const rootTypeName = resolveRootType(type).name
|
const rootTypeName = resolveRootType(type).name
|
||||||
|
|
||||||
const target = document.getElementById(`type_${rootTypeName}`)
|
const target = document.getElementById(`type_${rootTypeName}`)
|
||||||
if (target) {
|
if (target) {
|
||||||
gqlTabs.value.$el
|
target.scrollIntoView({ block: "center", behavior: "smooth" })
|
||||||
.querySelector(".gqlTabs")
|
target.classList.add(
|
||||||
.scrollTo({ top: target.offsetTop, behavior: "smooth" })
|
"transition-all",
|
||||||
|
"ring-inset",
|
||||||
|
"ring-accentLight",
|
||||||
|
"ring-4"
|
||||||
|
)
|
||||||
|
setTimeout(
|
||||||
|
() =>
|
||||||
|
target.classList.remove(
|
||||||
|
"ring-inset",
|
||||||
|
"ring-accentLight",
|
||||||
|
"ring-4",
|
||||||
|
"transition-all"
|
||||||
|
),
|
||||||
|
2000
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user