Skip to content

Commit b40e748

Browse files
fix: results bar positioning on mobile
1 parent 01a8329 commit b40e748

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/components/SearchResults.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const toggleExpand = () => {
102102

103103
<style scoped>
104104
.search-results {
105-
position: absolute;
105+
position: fixed;
106106
bottom: 0;
107107
left: 0;
108108
right: 0;
@@ -114,6 +114,11 @@ const toggleExpand = () => {
114114
max-height: 40vh;
115115
display: flex;
116116
flex-direction: column;
117+
transform: translateY(0);
118+
}
119+
120+
.search-results:not(.expanded) {
121+
transform: translateY(calc(100% - 52px));
117122
}
118123
119124
.results-header {
@@ -124,6 +129,8 @@ const toggleExpand = () => {
124129
cursor: pointer;
125130
border-bottom: 1px solid #eee;
126131
user-select: none;
132+
min-height: 52px;
133+
box-sizing: border-box;
127134
}
128135
129136
.result-count {
@@ -137,12 +144,14 @@ const toggleExpand = () => {
137144
font-size: 16px;
138145
cursor: pointer;
139146
color: #666;
147+
padding: 8px;
140148
}
141149
142150
.results-content {
143151
overflow-y: auto;
144152
padding: 10px;
145153
flex: 1;
154+
-webkit-overflow-scrolling: touch;
146155
}
147156
148157
.results-list {
@@ -213,18 +222,15 @@ const toggleExpand = () => {
213222
}
214223
215224
.search-results {
216-
max-height: 70vh;
225+
max-height: 80vh;
217226
}
218227
219228
.result-card {
220229
padding: 10px;
221230
}
222-
}
223231
224-
/* Ensure smooth scrolling on iOS */
225-
@supports (-webkit-touch-callout: none) {
226-
.results-content {
227-
-webkit-overflow-scrolling: touch;
232+
.search-results:not(.expanded) {
233+
transform: translateY(calc(100% - 52px));
228234
}
229235
}
230236
</style>

0 commit comments

Comments
 (0)