Skip to content

Commit 01b13a8

Browse files
committed
Remove <select> centering workaround for Safari.
Safari now properly supports centering.
1 parent 0db464c commit 01b13a8

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/timer.cubing.net/ui/StatsView.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import type { AttemptDataWithIDAndRev } from "../results/AttemptData";
33
// import {ScrambleID} from "./scramble-worker"
44
import { trForAttempt } from "./results-table";
55

6-
// WebSafari (WebKit) doesn't center text in `<select>`'s `<option>` tags: https://bugs.webkit.org/show_bug.cgi?id=40216
7-
// We detect Safari based on https://stackoverflow.com/a/23522755 so we can do an ugly workaround (manually adding padding using spaces) below.
8-
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
9-
106
type FormattedStats = {
117
mean3: string;
128
avg5: string;
@@ -127,13 +123,7 @@ export class StatsView {
127123
].map((s) => s.length),
128124
);
129125
function setStat(elem: HTMLOptionElement, s: string): void {
130-
let spacing = "";
131-
if (isSafari) {
132-
for (let i = 0; i < (maxLen - s.length) * 0.75; i++) {
133-
spacing += "&nbsp;";
134-
}
135-
}
136-
elem.innerHTML = spacing;
126+
elem.textContent = "";
137127
elem.appendChild(document.createTextNode(s));
138128
}
139129

0 commit comments

Comments
 (0)