Skip to content

Invisable ul #43

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

Closed
Syndlex opened this issue Oct 16, 2017 · 2 comments
Closed

Invisable ul #43

Syndlex opened this issue Oct 16, 2017 · 2 comments

Comments

@Syndlex
Copy link

Syndlex commented Oct 16, 2017

Hey,

As sone as I Implement the singleDropdown like in the Example I cant see the list items. They are generating but they are Invinsable. I dont know the reason for this.

The Code generating is:

<input placeholder="test" id="IngreName" class="active" style="" type="text">
<ul id="singleDropdown" class="dropdown-content ac-dropdown" style="display: block;">
<li class="ac-item" data-id="1" data-text="value">value</li>
<li class="ac-item" data-id="2" data-text="test">test</li>
</ul>

I use this JS code:

    $('#IngreName').materialize_autocomplete({
        limit: 10,
        dropdown: {
            itemTemplate: '<li class="ac-item" data-id="<%= item.id %>" data-text="<%= item.text %>"><%= item.text %></li>',
            el: '#singleDropdown'
        },
        getData: function (value, callback) {
            if (value.length >= 3) {
                $.get("/Ingredient/Search", {term: value})
                    .done(function (data) {
                        callback(value, data);
                    });
            }
        }
    });

My HTML is:

    <input th:type="text" th:id="IngreName" placeholder="test"/>
    <ul id="singleDropdown" class="dropdown-content ac-dropdown"></ul>
@bugsoftware
Copy link

dropdown: {
el: '#singleDropdown',
itemTemplate: '<li class="ac-item" data-id="<%= item.id %>" data-text='<%= item.text %>'><%= item.highlight %>'
}
item.highlight is bad, change to text
FIX:
dropdown: {
el: '#singleDropdown',
itemTemplate: '<li class="ac-item" data-id="<%= item.id %>" data-text='<%= item.text %>'><%= item.text %>'
}

@Syndlex
Copy link
Author

Syndlex commented Nov 8, 2017

ahh..

So highlight wasn't the fix i searched for.

For Some Reason materializecss is setting the opacity to 0.

added
$('#singleDropdown').css('opacity', 1);
into the done function.
Thanks for the help.

@Syndlex Syndlex closed this as completed Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants