We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
setActiveItem()
1 parent 58b1be9 commit 83bcc3cCopy full SHA for 83bcc3c
site/content/docs/5.0/examples/cheatsheet/cheatsheet.js
@@ -25,8 +25,8 @@
25
toast.show()
26
})
27
28
- // Disable empty links
29
- document.querySelectorAll('[href="#"]')
+ // Disable empty links and submit buttons
+ document.querySelectorAll('[href="#"], [type="submit"]')
30
.forEach(function (link) {
31
link.addEventListener('click', function (event) {
32
event.preventDefault()
@@ -41,6 +41,11 @@
41
}
42
43
var link = document.querySelector('.bd-aside a[href="' + hash + '"]')
44
+
45
+ if (!link) {
46
+ return
47
+ }
48
49
var active = document.querySelector('.bd-aside .active')
50
var parent = link.parentNode.parentNode.previousElementSibling
51
0 commit comments