From a332805f6e996a44e43bb780937d9a8ccea9e2ad Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 4 Dec 2024 08:19:43 +0800 Subject: [PATCH] Fix word overflow in file search page (#32695) (#32699) Backport #32695 by yp05327 Co-authored-by: yp05327 <576951401@qq.com> --- templates/repo/find/files.tmpl | 2 +- web_src/js/features/repo-findfile.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/repo/find/files.tmpl b/templates/repo/find/files.tmpl index 548ce2f0e8..ce242796be 100644 --- a/templates/repo/find/files.tmpl +++ b/templates/repo/find/files.tmpl @@ -9,7 +9,7 @@ - +
diff --git a/web_src/js/features/repo-findfile.js b/web_src/js/features/repo-findfile.js index cff5068a1e..e2b5657f22 100644 --- a/web_src/js/features/repo-findfile.js +++ b/web_src/js/features/repo-findfile.js @@ -90,6 +90,7 @@ function filterRepoFiles(filter) { const span = document.createElement('span'); // safely escape by using textContent span.textContent = part; + span.title = span.textContent; // if the target file path is "abc/xyz", to search "bx", then the matchResult is ['a', 'b', 'c/', 'x', 'yz'] // the matchResult[odd] is matched and highlighted to red. if (index % 2 === 1) span.classList.add('ui', 'text', 'red');