Doesn’t matter whether I quote the attr value or not - same complaint. I was just about to post a bug on Github (due to the after effects of this which were driving me crazy) when I spotted the console.log statement (where the breakpoint is placed). So TW is faithfully reporting the “error” via the catch even though it’s a valid selector, evidenced in the console.
Ideas? (Other than reporting it on Mozilla’s bugzilla).
I notice the query selector down in the console isn’t the same as the panel on the right. Don’t know if that’s relevant, but it seems a little odd. Maybe a clue?
@pmario Sadly, I can’t test that now, but I suspect not…
I had a severely cut down version of my code in a tiddler on tiddlywiki.com doing the obvious, trying to see what it would do on a vanilla TW. That’s what the screenshot shows. Then I spotted this, at the bottom…
That’s DuckDuckGo trying to do its thing to protect me from the evil ones. So, in process of trying to figure that out, I lost that cut down version of the code.
It’s late here so I’m gonna quit. I’ll take another look tomorrow.
I might suggest that’s focusing on the wrong thing. Regardless of the wikitext, the issue is manifested in querySelectorSafe in dom.js given a valid constructor, tested “live” in the console by hand.
It’s a simple enough idea to search my wiki for macros et al. When the user uses the top form with one field (Find single term) the border (box-shadow) glows green. When the user uses the lower form (Word 1, … Exclude 8) its border glows green ← that’s the state in the screenshot.
What I want to achieve:
When the user clicks in the top form, pretty much anywhere, focus is placed in the input box – easy, there’s only one edit box. That’s working fine.
When the user clicks in the lower form, close to an input (in the title say), focus is placed in the associated input box – not quite so easy, but it’s now working. However, there’s one thing that’s driving me crazy and its all to do with building that selector (a bit more complex than the edited down thing we looked at earlier).
Note: I considered using <label for...> but I shouldn’t need to. Maybe I will, later, but for now, I’d just like to solve this just to understand why it didn’t work: