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

fix(autocomplete): fix progressbar and messages alignment and bottom padding #6258

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/components/autocomplete/autocomplete.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
$autocomplete-option-height: 48px;
$input-container-padding: 2px !default;
$input-error-height: 24px !default;

@keyframes md-autocomplete-list-out {
0% {
Expand Down Expand Up @@ -51,14 +49,7 @@ md-autocomplete {
height: auto;

md-input-container {
padding-bottom: $input-container-padding + $input-error-height;

// When we have ng-messages, remove the input error height from our bottom padding, since the
// ng-messages wrapper has a min-height of 1 error (so we don't adjust height as often; see
// input.scss file)
&.md-input-has-messages {
padding-bottom: $input-container-padding;
}
padding-bottom: 0px;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be padding-bottom: $input-container-padding so that it is bottom-aligned with the input. Based on the GIF you provided, it looks like the progress bar sits above the input's bottom border which is incorrect.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope; don't listen to me...apparently that bumps the progress bar below the autocomplete.

}
md-autocomplete-wrap {
height: auto;
Expand Down
6 changes: 4 additions & 2 deletions src/components/autocomplete/demoFloatingLabel/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
* remote dataservice call.
*/
function querySearch (query) {
var results = query ? self.states.filter( createFilterFor(query) ) : [];
return results;
var results = query ? self.states.filter( createFilterFor(query) ) : self.states;
var deferred = $q.defer();
$timeout(function () { deferred.resolve( results ); }, Math.random() * 1000, false);
return deferred.promise;
}

/**
Expand Down