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

Commit 7429700

Browse files
topherfangioThomasBurleson
authored andcommitted
fix(autocomplete): Fix many issues with showing/hiding.
The logic behind showing and hiding the autocomplete's list of suggestions was difficult to understand and was causing some issues with displaying at the proper times. Refactor code to use a "show when criteria is met" approach instead of a "hide when criteria is met" approach and fix some issues with the md-not-found and suggestions list appearing when they should not. Fixes #4665. Fixes #4788. Fixes #4906. Fixes #4855. Fixes #4618. Fixes #4469. Fixes #4025. Closes #4958. **References:** Refs #4309, Refs #4678, Refs #4673, Refs #4518, Refs #4503, Refs #4358, Refs #4905.
1 parent 82160e1 commit 7429700

File tree

6 files changed

+336
-142
lines changed

6 files changed

+336
-142
lines changed

src/components/autocomplete/autocomplete.scss

+31-17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $input-error-height: 24px !default;
1616
opacity: 0;
1717
}
1818
}
19+
1920
@keyframes md-autocomplete-list-in {
2021
0% {
2122
opacity: 0;
@@ -31,6 +32,7 @@ $input-error-height: 24px !default;
3132
height: 40px;
3233
}
3334
}
35+
3436
md-autocomplete {
3537
border-radius: 2px;
3638
display: block;
@@ -78,26 +80,34 @@ md-autocomplete {
7880
&.md-menu-showing {
7981
z-index: $z-index-backdrop + 1;
8082
}
81-
md-progress-linear .md-mode-indeterminate {
83+
md-progress-linear {
8284
position: absolute;
83-
top: 20px; left: 0; width: 100%;
84-
height: 3px;
85-
transition: none;
85+
bottom: -2px;
86+
left: 0;
8687

87-
.md-container {
88-
transition: none;
88+
.md-mode-indeterminate {
89+
position: absolute;
90+
top: 0;
91+
left: 0;
92+
width: 100%;
8993
height: 3px;
90-
}
91-
&.ng-enter {
92-
transition: opacity 0.15s linear;
93-
&.ng-enter-active {
94-
opacity: 1;
94+
transition: none;
95+
96+
.md-container {
97+
transition: none;
98+
height: 3px;
9599
}
96-
}
97-
&.ng-leave {
98-
transition: opacity 0.15s linear;
99-
&.ng-leave-active {
100-
opacity: 0;
100+
&.ng-enter {
101+
transition: opacity 0.15s linear;
102+
&.ng-enter-active {
103+
opacity: 1;
104+
}
105+
}
106+
&.ng-leave {
107+
transition: opacity 0.15s linear;
108+
&.ng-leave-active {
109+
opacity: 0;
110+
}
101111
}
102112
}
103113
}
@@ -184,12 +194,12 @@ md-autocomplete {
184194
max-height: 41px * 5.5;
185195
z-index: $z-index-tooltip;
186196
}
197+
187198
.md-autocomplete-suggestions {
188199
margin: 0;
189200
list-style: none;
190201
padding: 0;
191202
li {
192-
cursor: pointer;
193203
font-size: 14px;
194204
overflow: hidden;
195205
padding: 0 15px;
@@ -203,6 +213,10 @@ md-autocomplete {
203213
&:focus {
204214
outline: none;
205215
}
216+
217+
&:not(.md-not-found-wrapper) {
218+
cursor: pointer;
219+
}
206220
}
207221
}
208222

0 commit comments

Comments
 (0)