-
Notifications
You must be signed in to change notification settings - Fork 29
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
It does not work with the latest version of materialize #52
Comments
I'm facing the same issue |
+1 |
I tried from my side to fix, couldn't do it (Not expert in CSS-JS stuff). This library is amazing and really needs to update to the new version of Materializecss. |
same issue here |
1 similar comment
same issue here |
Is this fixed? |
I'm seeing this issue still |
Came across this looking for answers. Wasn't able to find much so I dug into it a little further and noticed that it appends the ul dropdown to the first parent element of .input-field. In my case I didn't have that element. After I added that class, all good. My html below: <div class="col s4 center search input-field"> <!-- added .input-field -->
<input class="autocomplete" type="text" id="autocomplete-input" placeholder="Search" />
</div> |
@avidus3r I don't think you are using Materialize in its latest version (yours is probably < 1.0.0) The issue is linked to all the changes done to the Dropdown component : https://github.com/Dogfalo/materialize/blob/v1-dev/v1-upgrade-guide.md#dropdown I took Materialize Autocomplete's demo and tried to fix the issue by replacing Materialize's CDN to 1.0.0 instead of 0.9.7, and applied changes listed in the changelog. You can find the result here : https://codepen.io/WillyReyno/pen/wYBaeP You'll notice that the error is not displayed anymore, however the dropdown list is not triggered without clicking on the label... I don't understand why. Any ideas? @icefox0801 do you plan to upgrade this package to be compatible with Materialize 1.0.0 ? |
I am also experiencing this problem with Materialize 1.0.0. |
I was able to make the multiple autocomplete working on Materialize 1.0.0 by changing the main autocomplete js and adding some local jquery. Thanks to @AngyNoT to point out the start path. It's certainly not the best solution and I didn't have the time to test it, use at your own risk. Steps to make it work:
https://github.com/luisolf/materialize-autocomplete 2)Change the data-trigger attribute to data-target on your input element. 3)Call the function below on your ajax success function, inside the getData autocomplete method, after the callback call, and also on the input event of your input element.
|
Hey guys, I am also experiencing this problem with Materialize v1.0.0. I am using it with Django and crispy forms, for some weird reason I get an error when i follow the base sample on the materialize website Autocomplete, this is even before i insert my own data and it is so discouraging. Any clear thoughts so far on a possible solution to this issue? |
Just follow the steps I posted above to make it work on Materialize 1.0.0. |
Haha, you clearly say Use at your own risk lol, but i would give it a try. Thanks a lot. |
Just test it like you normally do with other stuff and see it fits your needs, So far I think it is working decently. |
All my previous autocomplete inputs in old Materialize already had input-field class on parent element, are you sure you are using Materialize 1.0.0? |
What version of Materialize are you using? |
@icefox0801's Materialize Autocomplete is not the same as Materialize Autocomplete. @tayhimself |
Any update? Having this same issue |
This is still persisting |
I encountered the same problem with the select element and M.FormSelect.init() but eventually I have figured out that my SELECT element must be appended to the DOM before I call M.FormSelect.init(), then this error is not thrown. |
Only solution as of now Solution is to add input field class div always in autocomplete to remove this error ...even in the latest version
Make sure your input type text is inside input-field div |
People still making a lot of confusion. This git issue is for Icefox's Autocomplete, not Materialize's default Autocomplete, the input-field thing is for the standard materialize autocomplete. Icefox's one stopped working on Materialize 1.0, due to the changes in dropdown object, but it is still better, has multiple item selection support, and those willing to make it work I point the way above, just follow the instructions I wrote. |
use id selector instead class selector. for example call dropdown like this :
js : |
Thanks for the fix man :D |
@avidus3r , Thank you, you saved my life. |
@avidus3r gave me the solution to this problem too, adding the class to the parent element of the input. Thank you !!! |
_this37.$inputField = _this37.$el.closest('.input-field'); so you have have the class <div class="row">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">textsms</i>
<input type="text" id="autocomplete-input" class="autocomplete">
<label for="autocomplete-input">Autocomplete</label>
</div>
</div>
</div>
</div> However, in the prior version As a word, if you are lucky to meet the problem. You have to add the class |
It does not work with the latest version of materialize 1.0.0-rc.1
Does anyone know a solution?
Thanks so much
ERROR MESSAGE:
The text was updated successfully, but these errors were encountered: