Keep item suggestions on screen and stop the page sliding sideways on phones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-03 20:25:34 -05:00
1 parent 3725f27d05
commit 6f459c7016
2 files changed
+22 -1

No files matched your search

+4
View File
@@ -10,6 +10,10 @@
let ac = $(this).autocomplete({
appendTo: "body",
minLength: 2,
// Kept on screen: on a phone a wide list of suggestions widened the page, which could leave the page
// stuck scrolled to the side
classes: { "ui-autocomplete": "line-item-suggestions" },
position: { my: "left top", at: "left bottom", collision: "flipfit" },
source: function(request, response) {
$.getJSON("/items/autocomplete", { q: request.term })
+18 -1
View File
@@ -244,7 +244,17 @@ table.list.line-items-table td:nth-child(n+2) {
pointer-events: none;
}
/* Item suggestions */
/* Item suggestions: no wider than the screen, long descriptions wrap */
.ui-autocomplete.line-item-suggestions {
max-width: calc(100vw - 16px);
box-sizing: border-box;
}
.line-item-suggestions .autocomplete-item {
white-space: normal;
overflow-wrap: anywhere;
}
.autocomplete-item {
line-height: 1.2;
}
@@ -263,6 +273,13 @@ table.list.line-items-table td:nth-child(n+2) {
color: #999;
}
/* Phones and narrow windows: Redmine's page wrapper hides what sticks out sideways but can still be scrolled
sideways by the browser (bringing a field or list into view), with no way to swipe it back. Clipping
instead keeps it in place. */
@media screen and (max-width: 899px) {
#wrapper { overflow-x: clip; }
}
/* Phones: each line becomes a small card (number, description and delete; quantity, price and total) */
@media screen and (max-width: 699px) {