Dogfalo / materialize

Materialize, a CSS Framework based on Material Design
https://materializecss.com
MIT License
38.86k stars 4.74k forks source link

Feature request: Autocomplete with input #2088

Closed SuperDJ closed 8 years ago

SuperDJ commented 9 years ago

Hello everyone,

I have seen some issues / requests about an autcomplete for form input. I have the same request but in the mean time this might help. I have made this using jQuery UI autocomplete plugin the css required is below. To make this work no jQuery UI theme should be active. I have styled it like the <select>

.ui-autocomplete {
    @extend .z-depth-1;
    background-color: #fff;
    position: fixed; // To prevent li elements go to the end of the screen

    li {
        @extend .col, .s12, .l4; // Edit this the way you like it. or to make it the same width as the input
        font-size: 1.2rem;
        color: #26a69a; // Teal color
        line-height: 1.5rem;
        padding: 1rem 1rem;

        &:hover {
            background: #eee;
        }
    }
}
    // Remove unwanted text comming from plugin
.ui-helper-hidden-accessible {
    display: none;
    visibility: hidden;
}
marciosouzajunior commented 9 years ago

Nice job!! Would be perfect get some like this: https://www.google.com/design/spec/components/text-fields.html#text-fields-auto-complete-text-field

SuperDJ commented 9 years ago

@marciosouzajunior sorry for the late response but I had a bussy time. I made a pull request for 2 feature requests. I'm not done with the autocomplete yet.

sushain97 commented 8 years ago

+1

rrgarciach commented 8 years ago

+1

arafiq commented 8 years ago

+1

jrizzo-za commented 8 years ago

+1

criticalbh commented 8 years ago

+1

SuperDJ commented 8 years ago

I would advice everyone to take a look here https://github.com/Dogfalo/materialize/pull/2669

ssaran791 commented 8 years ago

+1

adrianorosa commented 8 years ago

+1

drlh commented 8 years ago

+1 What about this older commit? https://github.com/SuperDJ/materialize/commit/3648f74542e41c3b3be4596870b7485f6ebdf176#diff-e4535828acef79852aa104417c16fe3dR157

bcbrockway commented 8 years ago

+1

acburst commented 8 years ago

Merged PR in a2a29db7470f4eedc804fd623d4e00377fd2cfcd