Skip to content

Commit 4952472

Browse files
committed
fix(codehints): stop unselected snippet badge from wrapping to a blank line
.custom-snippet-code-hint (the "Snippet" badge on default-snippet hint rows) was only position: absolute while its row was highlighted. When unhighlighted it fell back to static positioning with just visibility: hidden - which still reserves layout space - so the invisible badge text wrapped onto its own line inside the row, leaving a blank line and shifting every hint below it down as soon as selection moved off that row (e.g. pressing the down arrow). Make the badge position: absolute unconditionally so it's out of flow in both states; only visibility toggles with .highlight now.
1 parent 7853ef5 commit 4952472

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/styles/brackets_patterns_override.less

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,13 @@ a:focus {
839839
line-height: inherit;
840840
}
841841

842+
// Always absolutely positioned (not just while highlighted) so that when it's hidden
843+
// (visibility: hidden, below) it's taken out of normal flow entirely - otherwise, on a
844+
// static-positioned item that isn't highlighted, this label's own reserved inline box can
845+
// still wrap the row onto a second line, leaving a blank line behind and shifting every
846+
// hint below it down as selection moves off this item (see #618 follow-up).
842847
.custom-snippet-code-hint {
843848
visibility: hidden;
844-
}
845-
846-
.codehint-menu .dropdown-menu li .highlight .custom-snippet-code-hint {
847-
visibility: visible;
848849
position: absolute;
849850
right: 0;
850851
margin-top: -2px;
@@ -857,6 +858,10 @@ a:focus {
857858
}
858859
}
859860

861+
.codehint-menu .dropdown-menu li .highlight .custom-snippet-code-hint {
862+
visibility: visible;
863+
}
864+
860865
.custom-snippets-hint {
861866
min-width: 200px !important;
862867
max-width: 350px !important;

0 commit comments

Comments
 (0)