Final fix for Samsung missing '-" on keyboard.
This commit is contained in:
@@ -32,11 +32,10 @@ const styles = ({ palette }: Theme) => createStyles({
|
||||
});
|
||||
|
||||
|
||||
function isSamsungDevice() {
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
return userAgent.includes('samsung') || userAgent.includes('sm-');
|
||||
}
|
||||
|
||||
function isMobileDevice() {
|
||||
return (navigator.maxTouchPoints && navigator.maxTouchPoints > 1);
|
||||
}
|
||||
|
||||
interface NumericInputProps extends WithStyles<typeof styles> {
|
||||
ariaLabel: string;
|
||||
@@ -160,8 +159,8 @@ export const NumericInput =
|
||||
inputProps={{
|
||||
'aria-label': this.props.ariaLabel,
|
||||
style: { textAlign: 'right' },
|
||||
type: isSamsungDevice()? "text": "number",
|
||||
inputMode: "decimal",
|
||||
type: isMobileDevice()? "text": "number", // Avoids missing minus sign on Samsung mobile keyboard.
|
||||
inputMode: "numeric",
|
||||
autoComplete: "off",
|
||||
autoCorrect: "off",
|
||||
autoCapitalize: "off",
|
||||
|
||||
@@ -48,11 +48,11 @@ const MAX_ANGLE = 135;
|
||||
const FONT_SIZE = "0.8em";
|
||||
|
||||
|
||||
function isSamsungDevice() {
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
return userAgent.includes('samsung') || userAgent.includes('sm-');
|
||||
function isMobileDevice() {
|
||||
return (navigator.maxTouchPoints && navigator.maxTouchPoints > 1);
|
||||
}
|
||||
|
||||
|
||||
enum ButtonStyle { None, Trigger, Momentary, MomentaryOnByDefault }
|
||||
|
||||
|
||||
@@ -1094,7 +1094,8 @@ const PluginControl =
|
||||
) : (
|
||||
<div>
|
||||
<Input key={value}
|
||||
type={isSamsungDevice()? "text": "number"} inputMode="decimal"
|
||||
type={isMobileDevice()? "text": "number"}
|
||||
inputMode="numeric"
|
||||
defaultValue={control.formatShortValue(value)}
|
||||
error={this.state.error}
|
||||
inputProps={{
|
||||
|
||||
Reference in New Issue
Block a user