1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

change mouse enter logic

This commit is contained in:
Michael An
2023-10-11 16:40:18 +08:00
parent 7c1577505e
commit 716efbd929
3 changed files with 1 additions and 6 deletions

View File

@@ -6,8 +6,6 @@ import { Utils } from '../../utils/utils';
const propTypes = {
item: PropTypes.object.isRequired,
onItemClickHandler: PropTypes.func.isRequired,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
isHighlight: PropTypes.bool,
};
@@ -31,8 +29,6 @@ class SearchResultItem extends React.Component {
<li
className={classnames('search-result-item', {'search-result-item-highlight': this.props.isHighlight })}
onClick={this.onClickHandler}
onMouseEnter={this.props.onMouseEnter}
onMouseLeave={this.props.onMouseLeave}
>
<img className={item.link_content ? 'item-img' : 'lib-item-img'} src={fileIconUrl} alt="" />
<div className="item-content">

View File

@@ -307,8 +307,6 @@ class Search extends Component {
key={index}
item={item}
onItemClickHandler={this.onItemClickHandler}
onMouseEnter={(e) => this.setState({ highlightIndex: index })}
onMouseLeave={(e) => this.setState({ highlightIndex: -1 })}
isHighlight={index === highlightIndex}
/>
);

View File

@@ -105,6 +105,7 @@
border-radius: 4px;
}
.search-result-container .search-result-item:hover,
.search-result-container .search-result-item.search-result-item-highlight {
background-color: #f0f0f0;
}