-
Notifications
You must be signed in to change notification settings - Fork 8
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
jQuery error setting the ID field when item is selected #6
Comments
Please send me the source code where this is failing so I can reproduce this issue. Thanks very much. Which version of jQuery are you using? |
I'm using jQuery 1.10.2, the same as your sample application. I've done a little digging into this and it may have something to do with the complexity of how I was rendering the model. Specifically, the item I want to have a type ahead on is on "Model.Journey[i].CIty". This renders an Model annotations; |
Yes I have never tested this using a property off of an item in a collection which looks to be the problem here. If you do not mind, can you please send me your view, the model class and controller so I can test (basically enough code so I can drop it into a project and recreate what you are doing)? Thanks in advance and I appreciate you putting in an issue so that others who use this library may benefit. |
See attached for a basic working sample outlining the autocomplete-id-field issue. Text search is case sensitive. |
sorry! I missed your message. I haven't checked this project in a while. If this is still an issue, please let me know. |
No worries. Still an issue though we worked around it in the end |
Ok, thanks for reporting it! I've given you contributor access to the
project and there are 1 or 2 other active contributors as well. Feel free
to PR this change and merge it.
…On Fri, Sep 15, 2017 at 2:30 AM, DiskJunky ***@***.***> wrote:
No worries. Still an issue though we worked around it in the end
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALiMXiW46C4pVJH5_TAaox_zf7E11F45ks5sikPFgaJpZM4Hx8Q_>
.
|
There is a jQuery error when selecting an item returned from the typeahead query. It is unable to parse the complex value of "data-autocomplete-id-field".
Fix: Change typeahead.mvc.model.js, line 41 from;
$('#' + jQuery(obj.target).data("autocomplete-id-field")).val(datum.id.toString());
to
$(obj.target).siblings("input[type='text'].tt-hint:first").val(datum.id.toString());
It's worth noting that even if jQuery could parse the value, it still wouldn't work as the input field storing the ID from the returned results doesn't actually have a HTML id set.
The text was updated successfully, but these errors were encountered: