Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
enhance(autocomplete): prevents dropdown from showing briefly after some
Browse files Browse the repository at this point in the history
key presses

enhance(autocomplete): replaces 'x' button with md-icon

Related to #1484.
  • Loading branch information
Robert Messerle committed Feb 13, 2015
1 parent 70234b6 commit 223c3da
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/components/autocomplete/autocomplete-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ md-autocomplete {
background: '{{background-50}}';
button {
background: '{{background-200}}';
md-icon {
path {
fill: '{{foreground-2}}';
}
}
}
ul {
background: '{{background-50}}';
Expand Down
9 changes: 9 additions & 0 deletions src/components/autocomplete/autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ md-autocomplete {
border-radius: 50%;
padding: 0;
font-size: 12px;
md-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0) scale(0.6);
path {
stroke-width: 0;
}
}
&.ng-enter {
transform: scale(0);
transition: transform 0.15s ease-out;
Expand Down
2 changes: 1 addition & 1 deletion src/components/autocomplete/js/autocompleteController.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
break;
default:
self.index = -1;
self.hidden = false;
self.hidden = isHidden();
//-- after value updates, check if list should be hidden
$timeout(function () { self.hidden = isHidden(); });
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/autocomplete/js/autocompleteDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
type="button"\
ng-if="searchText"\
ng-click="$mdAutocompleteCtrl.clear()">\
<span aria-hidden="true">X</span>\
<md-icon md-svg-icon="close"></md-icon>\
<span class="visually-hidden">Clear</span>\
</button>\
<md-progress-linear ng-if="$mdAutocompleteCtrl.loading" md-mode="indeterminate"></md-progress-linear>\
Expand Down
16 changes: 11 additions & 5 deletions src/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ angular
// be removed from this startup process.


var svgRegistry = [{
id : "tabs-arrow",
url: "tabs-arrow.svg",
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g id="tabs-arrow"><polygon points="15.4,7.4 14,6 8,12 14,18 15.4,16.6 10.8,12 "/></g></svg>'
}];
var svgRegistry = [
{
id : "tabs-arrow",
url: "tabs-arrow.svg",
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g id="tabs-arrow"><polygon points="15.4,7.4 14,6 8,12 14,18 15.4,16.6 10.8,12 "/></g></svg>'
},
{
id : "close",
url: "close.svg",
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g id="close"><path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"/></g></svg>'
}];

svgRegistry.forEach(function(asset){
iconProvider.icon(asset.id, asset.url);
Expand Down

0 comments on commit 223c3da

Please sign in to comment.