Skip to content

Commit

Permalink
chore: cleanup isAndroid use-case
Browse files Browse the repository at this point in the history
  • Loading branch information
mizgaionutalexandru committed Sep 25, 2024
1 parent 0e4f66c commit bc1fe4d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/number-field/src/NumberField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -810,16 +810,12 @@ export class NumberField extends TextfieldBase {
const hasDecimals =
maximumFractionDigits && maximumFractionDigits > 0;

/* c8 ignore next 18 */
/* c8 ignore next 4 */
// iPhone doesn't have a minus sign in either numeric or decimal.
if (isIPhone() && hasNegative) inputMode = 'text';
else if (isIOS() && hasDecimals) inputMode = 'decimal';
else if (isAndroid()) {
// Android numeric has both a decimal point and minus key.
// decimal does not have a minus key.
if (hasNegative) inputMode = 'numeric';
else if (hasDecimals) inputMode = 'decimal';
}
else if ((isIOS() || isAndroid()) && hasDecimals)
inputMode = 'decimal';

this.inputElement.inputMode = inputMode;
}
if (
Expand Down

0 comments on commit bc1fe4d

Please sign in to comment.