materialize icon indicating copy to clipboard operation
materialize copied to clipboard

Select and prefix icons

Open philipraets opened this issue 11 years ago • 10 comments

Is there an option for having prefix-icons with selects?

This is what happens now: select with prefix

philipraets avatar Mar 06 '15 10:03 philipraets

+1 on prefix icons working for select... also for browser-default type selects if possible. Can't quite get it right easily right now

EeKay avatar Mar 19 '15 12:03 EeKay

I solved this manually, with this solution you can't have selects without prefix in your pages (but you can create another classe tough)

In form.scss, from line 458, added width: 92%; width: calc(100% - 3rem); margin-left: 3rem; and the media queries after display:block: @media #{$medium-and-down} { width: 86%; width: calc(100% - 3rem); }

@media #{$small-and-down} {
    width: 80%;
    width: calc(100% - 3rem);
}

Licorb avatar May 08 '15 14:05 Licorb

Same issue here. I create a jsFiddle to illustrate. https://jsfiddle.net/rz0zk5u6/8/

encubos avatar Jul 22 '15 03:07 encubos

adding this css to the current input-field prefix settings for input and textarea seems to work for me,

.input-field .prefix ~ div.select-wrapper 

so section becomes

  .input-field .prefix ~ input, .input-field .prefix ~ textarea , .input-field .prefix ~ div.select-wrapper {
    margin-left: 3rem;
    width: 92%;
    width: calc(100% - 3rem); }

cbruyndoncx avatar Jul 22 '15 12:07 cbruyndoncx

Same case here https://monosnap.com/file/tF1v6ODDdnKMKAGHh8pU1dbVTZEFc4

What is the progress on this? See also the error message display issue on image. I think it will be proper if we can have a help message class and it should be well indented whenever an prefix icon is used.

felixcheruiyot avatar Aug 27 '15 09:08 felixcheruiyot

Can confirm this. I'd be glad if this would be fixed. I'm using the materialize-sass gem for my rails projects. This would benefit, too.

Sajonara avatar Dec 11 '15 23:12 Sajonara

I think it should be fixed.

zhangfei614 avatar Dec 12 '15 05:12 zhangfei614

Fixed - https://jsfiddle.net/va9afvoo/

Can you please close the issue?

kmmbvnr avatar Mar 10 '17 05:03 kmmbvnr

This is not quite finished. When opening/closing the select, the class "active" should be toggled on the prefix icon. This will make the prefix icon consistent with other inputs.

@tomscholz Can you please reopen the issue and fix this? Or should I create a new issue?

TenaciousDan avatar Jun 25 '18 21:06 TenaciousDan

I'm fairly new to MaterializeCSS, so please forgive me if i'm incorrect.
After examining select.js, I believe all that is needed is to add the following line to beginning of _handleInputClick():

$(this.wrapper).prevAll("i.prefix").toggleClass('active');

TenaciousDan avatar Jun 25 '18 22:06 TenaciousDan