Skip to content
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

paper-autocomplete + floating label + allowClear=true #539

Closed
bdmac opened this issue Oct 31, 2016 · 3 comments · Fixed by #560
Closed

paper-autocomplete + floating label + allowClear=true #539

bdmac opened this issue Oct 31, 2016 · 3 comments · Fixed by #560

Comments

@bdmac
Copy link

bdmac commented Oct 31, 2016

Running against alpha6.

If I use paper-autocomplete with the floating label option and allowClear=true the reset button appears beneath the autocomplete input rather than inline with it as it seems like it should.

screen shot 2016-10-31 at 3 51 02 pm

The template code used for this is:

{{#paper-autocomplete
        label="Business Name"
        selected=selectedCluster
        search=(perform searchClusters)
        labelPath="name"
        searchMessage=false
        allowClear=true
        onSelectionChange=(action 'selectionChanged') as |cluster autocomplete|}}
    <span class="item-title">
      <span><strong>{{paper-autocomplete-highlight searchText=autocomplete.searchText label=cluster.name}}</strong> &mdash; {{cluster.address}} ({{cluster.cluster_id}})</span>
    </span>
{{/paper-autocomplete}}
@bdmac
Copy link
Author

bdmac commented Oct 31, 2016

FWIW I was able to get around this positioning issue with the following CSS:

md-autocomplete[md-floating-label] button {
  margin: 0 5px;
  top: 15px;
}

@xomaczar
Copy link
Contributor

xomaczar commented Nov 3, 2016

@bdmac looks nice.
@miguelcobain What's the behavior we want? I can't really see an example in AM where label & allowClear are used at the same time. Regardless, I think I like the css fix vs. not showing the clear button if allowClear=false -- if you don't want clear button then don't set allowClear.
Thoughts?

@miguelcobain
Copy link
Collaborator

miguelcobain commented Nov 3, 2016

@xomaczar looks like it landed on master two days ago: angular/material#9715

Maybe it's something we can backport?

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

Successfully merging a pull request may close this issue.

3 participants