Skip to content

Commit 677e10e

Browse files
authored
Merge pull request #36 from eugeneanokye99/master
Scroll on search results y overflow
2 parents 66e7570 + c76e371 commit 677e10e

File tree

4 files changed

+47
-14
lines changed

4 files changed

+47
-14
lines changed

package-lock.json

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/component/Sidebar/SearchComp.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function SearchComp (props){
1616
return <>
1717
<div className="searchcomp POPUPBG ">
1818

19-
{(props.displaypic === null) ? ( <img src={avatar} id="picincircle" />) :
20-
( <img src={props.displaypic} id="picincircle"/>)
19+
{(props.displaypic === null) ? ( <img src={avatar} id="picincircle" alt="avatar" />) :
20+
( <img src={props.displaypic} id="picincircle" alt="displaypic"/>)
2121

2222
}
2323
<div className="searchNames">

src/component/Sidebar/SideBar.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function Sidebar() {
123123
dispatch(SearchTweetWithTag(e.target.value.slice(1)))
124124
}
125125
dispatch(SearchUser(e.target.value));
126-
if (e.target.value != "") {
126+
if (e.target.value !== "") {
127127
document.getElementById("HOME2").style.display = "none"
128128
document.getElementById("SIDESEARCH").style.display = "flex"
129129
}
@@ -262,7 +262,7 @@ else{
262262
navigate("/notification")
263263
}}/>
264264
<div className="navSearch1">
265-
<img src={searchIcon} className="navSearch2" onClick={() => {
265+
<img src={searchIcon}alt="search" className="navSearch2" onClick={() => {
266266
navigate("/phonesearch")
267267
}} />
268268
</div>
@@ -300,10 +300,11 @@ else{
300300
<div id="SEARCHBOX">
301301
<div className="searchBar">
302302
<div className="searchBar_box">
303-
<img src={searchIcon} className="searchIcon" />
303+
<img src={searchIcon} className="searchIcon" alt="search" />
304304
<input className="searchbar POPUPBG" type="text" value={search} onChange={handleSearch} placeholder="Search" />
305305
</div>
306306
</div>
307+
307308
<div className="searchFlexBox POPUPBG" id="SIDESEARCH">
308309
{tohash ? (
309310
searchTweetList.length > 0 ? (searchTweetList.map((se) => {

src/component/Sidebar/Sidebar.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,19 +218,19 @@ a:hover {
218218

219219
/* SEARCH BAR */
220220

221-
/* #SIDESEARCH{
222-
position:fixed;
223-
overflow-y: scroll;
224-
scroll-behavior: smooth;
225-
} */
226-
227221
.searchFlexBox {
228222
position: fixed;
229-
top:90px;
223+
top: 90px;
230224
left: 70vw;
231225
/* width: 50vw; */
232226
display: flex;
233227
flex-direction: column;
228+
position:fixed;
229+
overflow-y: scroll;
230+
scroll-behavior: smooth;
231+
position: absolute;
232+
max-height: 550px;
233+
overflow-y: auto;
234234
}
235235
.searchBar{
236236
display: flex;
@@ -410,10 +410,10 @@ margin-left:-0.2vw;
410410
.searchbar{
411411
display: none;
412412
}
413-
.searchFlexBox{
413+
/* .searchFlexBox{
414414
display: none;
415415
416-
}
416+
} */
417417
.searchcomp, .searchAlter{
418418
display: none;
419419
/* display:flex; */

0 commit comments

Comments
 (0)