This repository was archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
typeahead expects li in template #5848
Milestone
Comments
@frfancha, please be respectful of our time by adhering to our issue template. additionally, please use MD formatting to make your issue text more readable. |
This is a valid issue. We shouldn't be doing DOM querying like this as it limits possibilities for template swapping. |
Offensive code is here: bootstrap/src/typeahead/typeahead.js Lines 409 to 415 in f88067a
|
We probably should change it to query for a class instead of a tag. |
Was looking at creating a PR for this, was wondering if using:
for the query selector would work. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The code:
target = popUpEl.find('li')[scope.activeIdx];
target.parentNode.scrollTop = target.offsetTop;
in typeahead.js in master fails (target is undefined) if the template doesn't contains -li- (we use -tr- instead of -li- and -table- instead of -ul- by typeahead-popup-template-url).
When the developper tool is not opened in the browser everything runs fine despite the error.
If using -li- is officialy required in custom templates, then this is a feature request to allow other html elements, and if -li- is already allowed today then it is to report the bug.
The text was updated successfully, but these errors were encountered: