Search code examples
autocompletematerialize

Materialize CSS Autocomplete Down Arrow Not Working


Here is my code. I tried to use default code but nothing work. In following i am fetching json from php and use it in autocomplete. dropdown is display but down arrow is not working.

I am using Materialize CSS Version 0.97.7

<div id="productEditor" class="row">
                    <div class="col s12">   
                        <!-- <input type="text" class="autocomplete" name="product_finder" id="product_finder" placeholder="Type Product To Add Or Update"> -->
                        <input type="text" id="autocomplete-input" class="autocomplete">
                        <script>
                            var autofilldata="";
                            function autocomplete_fetch()
                            {
                                $.ajax({
                                    url: "product_list.php",
                                    dataType: "json",
                                    success: function( data ) {
                                        console.log(data);
                                        autofilldata=data;
                                        setAutoFill();
                                    }
                                });
                            }
                            function setAutoFill()
                            {
                                $("input.autocomplete").autocomplete({
                                    data:autofilldata
                                });
                            }
                            $(document).ready(function($) {
                                autocomplete_fetch();   
                            });
                        </script>
                    </div>

Solution

  • I think there may be problem with my javascript file. So i test it with Latest CDN(0.98.2) and it worked.

    After working i thought to test it with version of 0.97.7 but this time i used CDN for it not local file

    In following version i test the code but down arrow is not working in autocomplete.

    0.97.7

    0.97.8

    0.98.0

    Both 0.97.7 and 0.97.8 down arrow is not working in autocomplete. But in 0.98.0 it works.

    So from now i decided to choose to use updated Framework. There will be always improvement in new version and in that version our question was solved.