Skip to content

Commit b53bb4d

Browse files
committed
PackageInput: fix dropdown menu misalignment
when devicePixelRatio = 1.25 in Firefox, the border width is 0.8 instead of 1. This happens with some other devicePixelRatio too.
1 parent 01b65f1 commit b53bb4d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

web/src/PackageInput.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
onMount(() => {
1313
const rect = input.getBoundingClientRect()
1414
ul.style.top = `${rect.height - 1}px`
15-
ul.style.width = `${rect.width - 2}px`
15+
ul.style.width = `${rect.width}px`
1616
});
1717
1818
function update_list_width() {
1919
const rect = input.getBoundingClientRect()
20-
ul.style.width = `${rect.width - 2}px`
20+
ul.style.width = `${rect.width}px`
2121
}
2222
2323
function may_complete() {
@@ -137,13 +137,14 @@
137137
input {
138138
padding-left: 5px;
139139
padding-right: 5px;
140-
width: min(50em, 100% - 1em);
140+
width: min(50em, 100%);
141141
box-shadow: 0 0 4px var(--color-inactive);
142142
}
143143
input,
144144
ul {
145145
border-radius: 0;
146146
border: 1px solid var(--color-inactive);
147+
box-sizing: border-box;
147148
}
148149
input:focus,
149150
input:focus ~ ul {

0 commit comments

Comments
 (0)