Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

feat(autocomplete): add md-require-match validator. #8344

Closed

Conversation

devversion
Copy link
Member

This adds a new validator to the autocomplete, which evaluates to false, when there currently is no item selected.

Fixes #2492.

@devversion devversion added the needs: review This PR is waiting on review from the team label May 4, 2016
@ThomasBurleson ThomasBurleson modified the milestone: Deprecated May 26, 2016
@devversion devversion modified the milestones: - Backlog, Deprecated May 27, 2016
@deeg
Copy link

deeg commented Jun 7, 2016

Is there any chance this will be reviewed and accepted?

@devversion
Copy link
Member Author

devversion commented Jun 15, 2016

@ThomasBurleson Please take a look if you have time - This is a very frequently requested feature and it's quite a simple PR.

@gpopovic
Copy link

@devversion I agree.....This is a must

@topherfangio
Copy link
Contributor

This looks good to me, but I think it would be nice to have a demo to show how it works.

I tried to throw one together really fast, but I ran into a few troubles which might have to do with the input container and the ng-messages.

@devversion Do you have time to put together a quick demo of how to use this new functionality?

@devversion
Copy link
Member Author

@topherfangio Definitely yeah. I will provide one tomorrow.

@devversion devversion force-pushed the feat/autocomplete-require-match branch from e372d6c to 52ff512 Compare June 22, 2016 16:50
@leibale
Copy link
Contributor

leibale commented Jul 6, 2016

what about this one?

md-floating-label="Favorite state">
<md-item-template>
<span md-highlight-text="ctrl.searchText">{{item.display}}</span>
</md-item-template>
<div ng-messages="searchForm.autocompleteField.$error" ng-if="searchForm.autocompleteField.$touched">
<div ng-message="required">You <b>must</b> have a favorite state.</div>
<div ng-message="md-require-match">You didn't select any favorite state.</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; thanks for the demo.

Can we just change this text to "Please select an existing state."?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@devversion devversion force-pushed the feat/autocomplete-require-match branch from 52ff512 to 9f2cf83 Compare July 11, 2016 17:37
@topherfangio
Copy link
Contributor

@ThomasBurleson LGTM 👍

@topherfangio topherfangio added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels Jul 11, 2016
@devversion devversion deleted the feat/autocomplete-require-match branch July 15, 2016 19:04
@Splaktar Splaktar removed this from the - Backlog milestone Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants