mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fix instant navigation when clicking on the logo button and logo is svg
This commit is contained in:
parent
5d0cae7ca6
commit
3ee51acca2
@ -180,7 +180,9 @@ export function setupInstantLoading(
|
||||
.pipe(
|
||||
filter(ev => !ev.metaKey && !ev.ctrlKey),
|
||||
switchMap(ev => {
|
||||
if (ev.target instanceof HTMLElement) {
|
||||
// Check for `Element` rather than `HTMLElement` to also
|
||||
// handle <svg> elements within <a> elements.
|
||||
if (ev.target instanceof Element) {
|
||||
const el = ev.target.closest("a")
|
||||
if (el && !el.target && urls.includes(el.href)) {
|
||||
ev.preventDefault()
|
||||
|
Loading…
Reference in New Issue
Block a user