mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-03 15:55:39 +00:00
fix manual anchor test
This commit is contained in:
parent
cf3ece96ab
commit
1e211eee87
@ -1289,7 +1289,7 @@ var htmx = (function() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (swapOptions.anchor) {
|
if (swapOptions.anchor) {
|
||||||
const anchorTarget = resolveTarget(swapOptions.anchor)
|
const anchorTarget = resolveTarget("#" + swapOptions.anchor)
|
||||||
if (anchorTarget) {
|
if (anchorTarget) {
|
||||||
anchorTarget.scrollIntoView({ block: 'start', behavior: 'auto' })
|
anchorTarget.scrollIntoView({ block: 'start', behavior: 'auto' })
|
||||||
}
|
}
|
||||||
@ -3566,8 +3566,7 @@ var htmx = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// restore any anchor associated with the request
|
// restore any anchor associated with the request
|
||||||
if (responseInfo.pathInfo.anchor &&
|
if (responseInfo.pathInfo.anchor && path.indexOf('#') === -1) {
|
||||||
path.indexOf('#') === -1) {
|
|
||||||
path = path + '#' + responseInfo.pathInfo.anchor
|
path = path + '#' + responseInfo.pathInfo.anchor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user