1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

fix tag list ID bug (#5673)

This commit is contained in:
Michael An
2023-10-09 14:14:24 +08:00
committed by GitHub
parent f6bc23201e
commit 4f5265dc3a

View File

@@ -91,6 +91,7 @@ class DirentListItem extends React.Component {
isOpMenuOpen: false // for mobile isOpMenuOpen: false // for mobile
}; };
this.tagListTitleID = `tag-list-title-${uuidv4()}`; this.tagListTitleID = `tag-list-title-${uuidv4()}`;
this.tagListStackedID = `tag-list-stacked-${uuidv4()}`;
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
@@ -751,10 +752,10 @@ class DirentListItem extends React.Component {
</Fragment> </Fragment>
)} )}
</td> </td>
<td className="tag-list-title"> <td className="tag-list-title" id={this.tagListTitleID}>
{(dirent.type !== 'dir' && dirent.file_tags && dirent.file_tags.length > 0) && ( {(dirent.type !== 'dir' && dirent.file_tags && dirent.file_tags.length > 0) && (
<Fragment> <Fragment>
<div id={this.tagListTitleID} className="dirent-item tag-list tag-list-stacked"> <div className="dirent-item tag-list tag-list-stacked" id={this.tagListStackedID}>
{dirent.file_tags.map((fileTag, index) => { {dirent.file_tags.map((fileTag, index) => {
let length = dirent.file_tags.length; let length = dirent.file_tags.length;
return ( return (
@@ -762,7 +763,7 @@ class DirentListItem extends React.Component {
); );
})} })}
</div> </div>
<UncontrolledTooltip target={this.tagListTitleID} placement="bottom"> <UncontrolledTooltip target={this.tagListStackedID} placement="bottom">
{tagTitle} {tagTitle}
</UncontrolledTooltip> </UncontrolledTooltip>
</Fragment> </Fragment>