--- scrollspy-method.js
+++ scrollspy-method.js
@@ -10,11 +10,13 @@
         continue
       }

-      const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)
+      const decodedHash = decodeURI(anchor.hash)
+      const escapedSelector = parseSelector(decodedHash)
+      const observableSection = SelectorEngine.findOne(escapedSelector, this._element)

       // ensure that the observableSection exists & is visible
       if (isVisible(observableSection)) {
-        this._targetLinks.set(decodeURI(anchor.hash), anchor)
+        this._targetLinks.set(decodedHash, anchor)
         this._observableSections.set(anchor.hash, observableSection)
       }
     }
   }
