Closed randycoulman closed 3 months ago
#hello?
isn't a valid selector, both Chrome and Firefox raise an error with it
> document.querySelector("#hello?")
VM74:1 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#hello?' is not a valid selector.
You'll need to use Floki.get_by_id/2 or |> Floki.find("[id='hello?']")
Wow, interesting! Thanks for taking a look @ypconstante! I did search for whether that was a valid DOM id, and it seems to be from what I can tell. But if it doesn't work as a selector, that makes things difficult.
I'll close this.
Description
I originally thought that this might be a bug in PhoenixTest, but it looks it's actually in Floki.
If I have a form field with an id ending in a
?
character (e.g.active?
), Floki is unable to find the element. If I remove the?
, then all is well.To Reproduce
(h/t to @germsvel for coming up with a simple example)
Steps to reproduce the behavior:
With this code:
Expected behavior
I'd expect Floki to be able to find the element.