-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two listeners + Two API calls doesn't work #395
Comments
I've just spent the last hour testing and testing, and I just wanted to confirm that the API sends me the correct data. It's just that for some weird reason, the atwho HTML dom element goes "display:none" after the first character, even if it is populated with the correct HTML list ( |
I encountered a similar issue when I wrote this emoji userscript. I found that the regular expression within the matcher: function(flag, subtext) {
var regexp = ghe.regex.emojiImgFilter,
match = regexp.exec(subtext);
// this next line does some magic...
// for some reason, without it, moving the caret from "p" to "r" in
// ":_people,fear," opens & closes the popup with each letter typed
subtext.match(regexp);
if (match) {
return match[2] || match[1];
} else {
return null;
}
} |
Hey! First of all, thank you so much for your assistance! Looking at the small amount of answers in here, I actually did not expect anyone to help. I've just tried combining my code and yours, and I wasn't able to get it to work :-( This got me wondering how much of the emoji code should I bring in my code (the emojiImgFilter regex, but then this is includes within the imgParts[] array), or should I just keep my code and simply add the "subtext.match(regexp);" line? Again, thank you so much for your help. I'm going to try merging my code with your reference some more. |
This is what I have right now (after trying to merge both codes) :
Unfortunately doesn't work. Still closes unexpectedly when typing "event:Fo...". |
@Mottie By no means do I want to annoy you with this, please don't respond if you weren't initially going to reply to my response, no hard feelings. I'm just tagging you because I have no idea if you were notified of my response or not. Again, thanks a million for your help. I'm still fiddling with the snippet of code you gave me. |
Sorry, I did see your post. I don't think I have any thing else to contribute at this time. Maybe if you modify this demo to duplicate the problem, I can attempt to help further. |
@Mottie Hey, no worries. Again, thanks a million for your assistance. I'll keep trying things and post the solution here when I find it. Thanks for the demo's link, I'll give it a shot. |
Oh. Wow. I figured it out. Before:
After :
I didn't realize that the variables (ex: '${name}') in the 'displayTpl'/'insertTpl' had to be the actual objects' keys, and not the key names I was giving them in my eventList array ('eventName'). But again, this doesn't make 100% sense, since I'm naming/labeling my own keys in the tagUsersConfig options and inserting those into the 'displayTpl'/'insertTpl' and it's all working fine... So confusing. Damn. Took me a whole day to figure that out. Oh well. Thanks again @Mottie. |
I have the weirdest bug right now. I've checked and re-checked everything 100 times.
I assign 2 listeners to a form. 1 fetches users with the "@" symbol, the other fetches events with the "event:" text.
The "tagUsersConfig" one works great, but the "tagEventsConfig" behaves weirdly. It fetches the first 5 events, then as soon as I start typing the first letter, the list dissapears, even if I know for a fact (in the console) that for each character I type, it's sending me back json objects from the API (all of which are accurate depending on the typed letter).
If I paste the users' API query in the tagEventsConfig (events) one, the "event:" now works. The weirdest part is (and you're going to have to take my word for it), the events API call and its variables are all perfectly correct and valid.
Thank you very much for your time.
The text was updated successfully, but these errors were encountered: