Fix phone number letter spacing
This commit is contained in:
parent
2de396521e
commit
2c4b3080a5
@ -14,7 +14,7 @@ import Page from "./page";
|
|||||||
import InputField from "../components/inputField";
|
import InputField from "../components/inputField";
|
||||||
import CheckboxField from "../components/checkboxField";
|
import CheckboxField from "../components/checkboxField";
|
||||||
import Button from "../components/button";
|
import Button from "../components/button";
|
||||||
import { isAppleMobile } from "../helpers/userAgent";
|
import { isAndroid, isApple, isAppleMobile, isSafari } from "../helpers/userAgent";
|
||||||
import fastSmoothScroll from "../helpers/fastSmoothScroll";
|
import fastSmoothScroll from "../helpers/fastSmoothScroll";
|
||||||
import { isTouchSupported } from "../helpers/touchSupport";
|
import { isTouchSupported } from "../helpers/touchSupport";
|
||||||
import App from "../config/app";
|
import App from "../config/app";
|
||||||
@ -269,8 +269,14 @@ let onFirstMount = () => {
|
|||||||
|
|
||||||
const pixelRatio = window.devicePixelRatio;
|
const pixelRatio = window.devicePixelRatio;
|
||||||
if(pixelRatio > 1) {
|
if(pixelRatio > 1) {
|
||||||
const letterSpacing = -(pixelRatio * .16) + 'px';
|
let letterSpacing: number;
|
||||||
telEl.style.setProperty('--letter-spacing', letterSpacing);
|
if(isApple) {
|
||||||
|
letterSpacing = pixelRatio * -.16;
|
||||||
|
} else if(isAndroid) {
|
||||||
|
letterSpacing = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
telEl.style.setProperty('--letter-spacing', letterSpacing + 'px');
|
||||||
}
|
}
|
||||||
|
|
||||||
const originalFunc = telInputField.setValueSilently.bind(telInputField);
|
const originalFunc = telInputField.setValueSilently.bind(telInputField);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user