Skip to content

Commit

Permalink
Fix search box hover behavior replacing input text (#4027)
Browse files Browse the repository at this point in the history
* Fix search box hover behavior replacing input text

* Fix hover behavior and improve scrolling for search box
  • Loading branch information
dubeanant authored Oct 4, 2024
1 parent 087cd49 commit bae54ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions css/activities.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
transition: width 0.4s ease-in-out;
font-size: 24px;
color: black;
max-width: 100%;
}

#search:focus {
Expand All @@ -75,6 +76,8 @@
position: relative;
background-color: rgba(255, 255, 255, 1);
max-width: 396px;
max-height: 200px;
overflow-y: auto;
font-size: 18px;
border: 2px solid #87cefa;
list-style-type: none;
Expand Down
16 changes: 8 additions & 8 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2385,27 +2385,27 @@ class Activity {
that.doSearch();
if (event.keyCode === 13) this.searchWidget.style.visibility = "visible";
},
focus: (event, ui) => {
focus: (event) => {
event.preventDefault();
that.searchWidget.value = ui.item.label;
}
});

$j("#search").autocomplete("widget").addClass("scrollSearch");

$j("#search").autocomplete("instance")._renderItem = (ul, item) => {
return $j("<li></li>")
.data("item.autocomplete", item)
.append(
'<img src="' +
item.artwork +
'" height = "20px">' +
"<a>" +
" " +
'" height="20px">' +
"<a> " +
item.label +
"</a>"
)
.appendTo(ul.css("z-index", 9999));
.appendTo(ul.css({
"z-index": 9999,
"max-height": "200px",
"overflow-y": "auto"
}));
};
const searchInput = this.searchWidget.idInput_custom;
if (!searchInput || searchInput.length <= 0) return;
Expand Down

0 comments on commit bae54ef

Please sign in to comment.