CreativeBulma / bulma-tagsinput

Bulma's extension providing user interface to manage tags supporting autocomplete.
MIT License
62 stars 21 forks source link

DOMException: Failed to execute 'querySelectorAll' on 'Document': '[object HTMLInputElement]' is not a valid selector. #4

Closed NickDarvey closed 4 years ago

NickDarvey commented 4 years ago

Edit: Yeah you know what it was? I installed bulma-tagsinput, not @CreativeBulma/bulma-tagsinput. Classic!


I'm having an issue attaching to a HTMLInputElement (when passed as an element).

Repro

  1. Add this library directly to an index.html
    <input id="cheese" type="tags" class="input">
    <script src="dist/bulma-tagsinput.min.js"></script>
  2. Open Chrome debug console
  3. Fetch the input element
    var test = document.getElementById("cheese")
  4. Attach tagsinput
    bulmaTagsinput.attach(test)

Expected

test.BulmaTagsInput() is available.

Actual

bulma-tagsinput.min.js:formatted:361 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '[object HTMLInputElement]' is not a valid selector.
    at Function.value (https://localhost:5001/dist/bulma-tagsinput.min.js:1:8944)

Other Info

I would expect this line to be hit: https://github.com/CreativeBulma/bulma-tagsinput/blob/d4b3088d0df78b43b2f6ba011dea81e521e52358/src/js/utils/type.js#L10 because it does return true when I try it in my debug console.

Looking at the minified javascript, it doesn't look like it's hit.