-
Notifications
You must be signed in to change notification settings - Fork 45
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
md-autocomplete #6
Comments
Added basic functionality in fbf7bfc |
Not sure if something changed, but I had to double escape the single quotes in md-items in the autocomplete.html file.
|
@brianpkelley it may have, which version of MD did you run with? |
Angular 1.5.6 I also commented on #11 not sure if it notified you. |
Disclaimer Sorry for spamming code everywhere, I'd love to pull down a fresh copy but just don't have the time right now. Rushing to get a project out the door for work, so I'm posting these as notes for anyone with time or for when I get time to issue clean PR's In the same vein as #18, md-autocomplete (and other fields that are of type // Object fields (material - autocomplete ) will give a null value when we're looking for an object or undefined
if (schema.type === 'object' && value === null) {
value = undefined;
} I know this is still a work in progress, but I needed to make a few changes to the md-autocopmlete template to work with errors. Because the if ( args.form.schema.requireMatch ) {
mdAutocompleteFrag.setAttribute('md-require-match', true);
} <div class="form-group {{::form.htmlClass ? form.htmlClass : 'flex-100'}} schema-form-select " sf-layout>
<md-autocomplete flex
sf-messages
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"
ng-disabled="form.readonly"
ng-model="$$value$$"
sf-autocomplete
sf-field-model="replaceAll"
sf-changed-auto-complete="form"
schema-validate="form"
md-selected-item="$$value$$"
md-search-text="searchText"
md-selected-item-change="'todo';"
md-items="item in evalExpr('this[\\''+form.optionFilter+'\\'](\\''+searchText+'\\')')"
md-item-text="item.name"
md-floating-label="{{::form.title}}"
md-menu-class="autocomplete-custom-template"
>
<md-item-template>
<span md-highlight-text="searchText">{{item.name}}</span>
</md-item-template>
<md-not-found>
No matches found
</md-not-found>
</md-autocomplete>
</div> |
Thanks @brianpkelley back from holiday so I'll try to sort it out soon, yes autocomplete was the least finished of all the components, really hacked together for my own project at the time. |
Add autocomplete and allow for template usage.
Based on: https://material.angularjs.org/HEAD/#/demo/material.components.autocomplete
Needs to allow template via schema form attribute or reference to included template.
The text was updated successfully, but these errors were encountered: