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