Discussion:
[jifty-devel] Quirk of Jifty autocomplete java script
Mark Aufflick
2010-02-01 22:20:32 UTC
Permalink
Hi all,

Please forgive a cross-post from IRC since noone seemed to be around
yesterday to answer it:

my autocompleted fields have an annoying property where every second
character I type, the drop down will disappear even though it should match -
type a further (matching) character and it appears again

eg, imagine a field of country names, and I'm typing Australia:

AU (dropdown appears) S (dropdown disappears, and stays away no matter how
long you wait) T (dropdown appears) R (disappears) A (appears) ... etc

on a more minor issue, if you then backspace all the way to a blank box I
get a visible, but tiny, square which is a completely empty drop down

I'll dig into the jifty JS if required, but I thought I'd see if anyone else
solved this before I do. I assume the trunk is substantially different to
CPAN...

Cheers,

Mark.
--
Mark Aufflick
contact info at http://pumptheory.com/about

http://pumptheory.com
iPhone and Enterprise software development
Jesse Vincent
2010-02-04 17:14:43 UTC
Permalink
Post by Mark Aufflick
Hi all,
Please forgive a cross-post from IRC since noone seemed to be around yesterday
my autocompleted fields have an annoying property where every second character
I type, the drop down will disappear even though it should match - type a
further (matching) character and it appears again
AU (dropdown appears) S (dropdown disappears, and stays away no matter how long
you wait) T (dropdown appears) R (disappears) A (appears) ... etc
on a more minor issue, if you then backspace all the way to a blank box I get a
visible, but tiny, square which is a completely empty drop down
I'll dig into the jifty JS if required, but I thought I'd see if anyone else
solved this before I do. I assume the trunk is substantially different to
CPAN...
Trunk is continuing to evolve, but it's only been about two months since
the last CPAN release.

I think the issue is that the menu is closing because it's
invalidating the previous dropdown and going back to the server to get a
new one... but I don't know why it's not coming back. I'm not seeing the
tiny box, but I am seeing the alternate-character issue.

A patch would be hugely appreciated.
Post by Mark Aufflick
Cheers,
Mark.
--
Mark Aufflick
contact info at http://pumptheory.com/about
http://pumptheory.com
iPhone and Enterprise software development
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
Mark Aufflick
2010-02-08 01:21:32 UTC
Permalink
(posted from wrong list email - reposting)

The issue is the lastValue value being updated ahead of when it should on
every second keystroke. The iautocompleter code seems over complicated! I
was able to replicate the issue with just iautocompleter.js (obviously no
remote requests happening but I could see the lastValue being updated
incorrectly on alternate keystrokes in the debugger) so it's not just the
replacement update() function.

I have a hack - not a real fix - which requires changing iautocompleter.js
and jifty_interface.js. It also has a slight improvement to remove the time
where there used to be no drop down between a keystroke and receiving the
ajax request (I moved the call to clear() into the success handler).

I'll email the diffs when I get home for posterity but I'll also plan to
move to trunk and then I can fork the github project and apply the patch
there.

Cheers,

Mark.
Post by Mark Aufflick
Post by Mark Aufflick
Hi all,
Please forgive a cross-post from IRC since noone seemed to be around
yesterday
Post by Mark Aufflick
my autocompleted fields have an annoying property where every second
character
Post by Mark Aufflick
I type, the drop down will disappear even though it should match - type a
further (matching) character and it appears again
AU (dropdown appears) S (dropdown disappears, and stays away no matter
how long
Post by Mark Aufflick
you wait) T (dropdown appears) R (disappears) A (appears) ... etc
on a more minor issue, if you then backspace all the way to a blank box I
get a
Post by Mark Aufflick
visible, but tiny, square which is a completely empty drop down
I'll dig into the jifty JS if required, but I thought I'd see if anyone
else
Post by Mark Aufflick
solved this before I do. I assume the trunk is substantially different to
CPAN...
Trunk is continuing to evolve, but it's only been about two months since
the last CPAN release.
I think the issue is that the menu is closing because it's
invalidating the previous dropdown and going back to the server to get a
new one... but I don't know why it's not coming back. I'm not seeing the
tiny box, but I am seeing the alternate-character issue.
A patch would be hugely appreciated.
Post by Mark Aufflick
Cheers,
Mark.
--
Mark Aufflick
contact info at http://pumptheory.com/about
http://pumptheory.com
iPhone and Enterprise software development
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
Mark Aufflick
contact info at http://pumptheory.com/about

http://pumptheory.com
iPhone and Enterprise software development
Jesse Vincent
2010-02-08 01:38:11 UTC
Permalink
Post by Mark Aufflick
The iautocompleter code seems over complicated!
Yes. I've been looking at the codepath. It can definitely be made
simpler and cleaner. I look forward to your patches.
Mark Aufflick
2010-02-08 03:30:57 UTC
Permalink
To avoid future disappointment I should point out my current patches don't
make the codepath any simpler or cleaner :)
Post by Jesse Vincent
Post by Mark Aufflick
The iautocompleter code seems over complicated!
Yes. I've been looking at the codepath. It can definitely be made
simpler and cleaner. I look forward to your patches.
--
Mark Aufflick
contact info at http://pumptheory.com/about

http://pumptheory.com
iPhone and Enterprise software development
Loading...