Skip to content
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

Doesn't work on element not yet in DOM. #908

Open
kevincox opened this issue Jul 16, 2014 · 2 comments
Open

Doesn't work on element not yet in DOM. #908

kevincox opened this issue Jul 16, 2014 · 2 comments

Comments

@kevincox
Copy link

Currently when used on an element not yet added to the DOM the requests are still fired but no UI is presented with the suggestions. It would be nice if this use case was supported.

Example: http://jsfiddle.net/kevincox/fLfEJ/

This would be nice because when generating UI it is a good performance practice to generate it out-of-dom and then add everything in one action. It can also be awkward to delay initialization until the node is added.

@jharding
Copy link
Contributor

Well right now the typeahead.js UI needs to make DOM modifications (e.g. add the hint input and the dropdown menu). Albeit I haven't looked into it at all, I'm not sure how I could support your use case with that being the case.

I have a WIP branch (#902) that may make solving this problem more feasible.

@kevincox
Copy link
Author

To be honest I haven't looked at the source either. However I believe it should be possible as you can still build a DOM tree as long as you don't try to get any computed properties as the elements are not rendered at this time. I don't know how feasible this is for typeahead though.

I will check out the WIP branch and see if that affects anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants