Full suggestion text is shown on hover

The width of the suggestion box is capped at 600 pixels. The full
text of a suggestion is shown on hover (doesn't work on mobile).
This commit is contained in:
Veloman Yunkan
2025-01-28 19:08:42 +04:00
parent 64eb0d10d6
commit 2eea6136d6
3 changed files with 15 additions and 5 deletions

View File

@@ -23,7 +23,9 @@
.autoComplete_wrapper > ul {
position: absolute;
min-width: 100%;
width: fit-content;
max-width: 600px;
max-height: 226px;
overflow-y: scroll;
top: 100%;
@@ -61,6 +63,11 @@
transition: all 0.2s ease;
}
.autoComplete_wrapper > ul > li > a {
overflow: hidden;
text-overflow: ellipsis;
}
.autoComplete_wrapper > ul > li::selection {
color: rgba(#ffffff, 0);
background-color: rgba(#ffffff, 0);

View File

@@ -92,7 +92,10 @@ function makeJSLink(jsCodeString, linkText, linkAttr="") {
// in the JS code we have to URI-encode a second time.
// (see https://stackoverflow.com/questions/33721510)
const uriEncodedJSCode = encodeURIComponent(jsCodeString);
return `<a ${linkAttr} href="javascript:${uriEncodedJSCode}">${linkText}</a>`;
const linkPlainText = htmlDecode(linkText, "text/html");
linkAttr += ` href="javascript:${uriEncodedJSCode}"`;
linkAttr += ` title="${linkPlainText}"`;
return `<a ${linkAttr}>${linkText}</a>`;
}
function suggestionsApiURL()