Skip to content

Commit bae54ef

Browse files
authored
Fix search box hover behavior replacing input text (#4027)
* Fix search box hover behavior replacing input text * Fix hover behavior and improve scrolling for search box
1 parent 087cd49 commit bae54ef

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

css/activities.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
transition: width 0.4s ease-in-out;
6262
font-size: 24px;
6363
color: black;
64+
max-width: 100%;
6465
}
6566

6667
#search:focus {
@@ -75,6 +76,8 @@
7576
position: relative;
7677
background-color: rgba(255, 255, 255, 1);
7778
max-width: 396px;
79+
max-height: 200px;
80+
overflow-y: auto;
7881
font-size: 18px;
7982
border: 2px solid #87cefa;
8083
list-style-type: none;

js/activity.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,27 +2385,27 @@ class Activity {
23852385
that.doSearch();
23862386
if (event.keyCode === 13) this.searchWidget.style.visibility = "visible";
23872387
},
2388-
focus: (event, ui) => {
2388+
focus: (event) => {
23892389
event.preventDefault();
2390-
that.searchWidget.value = ui.item.label;
23912390
}
23922391
});
23932392

2394-
$j("#search").autocomplete("widget").addClass("scrollSearch");
2395-
23962393
$j("#search").autocomplete("instance")._renderItem = (ul, item) => {
23972394
return $j("<li></li>")
23982395
.data("item.autocomplete", item)
23992396
.append(
24002397
'<img src="' +
24012398
item.artwork +
2402-
'" height = "20px">' +
2403-
"<a>" +
2404-
" " +
2399+
'" height="20px">' +
2400+
"<a> " +
24052401
item.label +
24062402
"</a>"
24072403
)
2408-
.appendTo(ul.css("z-index", 9999));
2404+
.appendTo(ul.css({
2405+
"z-index": 9999,
2406+
"max-height": "200px",
2407+
"overflow-y": "auto"
2408+
}));
24092409
};
24102410
const searchInput = this.searchWidget.idInput_custom;
24112411
if (!searchInput || searchInput.length <= 0) return;

0 commit comments

Comments
 (0)