Skip to content

fix(frontend): trigger numeric keypad for Currency Input on iOS#41731

Open
Arbab1308 wants to merge 3 commits intoappsmithorg:releasefrom
Arbab1308:fix/currency-inputmode-clean
Open

fix(frontend): trigger numeric keypad for Currency Input on iOS#41731
Arbab1308 wants to merge 3 commits intoappsmithorg:releasefrom
Arbab1308:fix/currency-inputmode-clean

Conversation

@Arbab1308
Copy link
Copy Markdown

@Arbab1308 Arbab1308 commented Apr 9, 2026

Description

This PR improves mobile data entry by setting inputMode="decimal" for the Currency Input widget, so iOS/Android show the numeric keypad instead of the full keyboard.

What changed

  • Added inputMode support in BaseInputWidget.
  • Passed inputMode="decimal" for CurrencyInput widget.
  • Keeps desktop behavior unchanged.

Testing

  • GitHub Actions CI on this PR

Fixes

Summary by CodeRabbit

  • New Features
    • Mobile keyboard will now adapt to the input type, displaying appropriate keyboard layouts for currency, email, telephone, and other input fields on mobile devices.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Walkthrough

The changes introduce mobile keyboard layout support by adding an InputMode enum with HTML5 inputmode attribute values and a helper function to map input types to appropriate keyboard modes. Currency Input now explicitly sets its input type to NUMBER to trigger numeric keyboard on mobile devices.

Changes

Cohort / File(s) Summary
Input Mode Support Infrastructure
app/client/src/widgets/BaseInputWidget/constants.ts, app/client/src/widgets/BaseInputWidget/component/index.tsx
Added InputMode enum with HTML5 inputmode values and getInputMode() helper that maps inputHTMLType values to keyboard layout strings (NUMBER"decimal", TEL"tel", EMAIL"email").
Currency Input Enhancement
app/client/src/widgets/CurrencyInputWidget/component/index.tsx
Added explicit inputHTMLType="NUMBER" prop to trigger numeric keyboard on mobile platforms.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🔢 From keyboards wide, a fix takes flight,
Currency inputs, numeric and bright,
iOS cashiers tap with ease,
No more hunting—numbers please! 💰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding inputMode support to trigger the numeric keypad for Currency Input on iOS.
Description check ✅ Passed The description covers the key changes, testing approach, and references the linked issue #41496, meeting the template requirements.
Linked Issues check ✅ Passed The PR successfully implements the fix for issue #41496 by adding inputMode support and applying it to Currency Input for iOS numeric keypad display.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing the linked issue: adding InputMode enum, implementing getInputMode helper, and applying it to CurrencyInput.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Arbab1308 Arbab1308 changed the title Fix/currency inputmode clean fix(frontend): trigger numeric keypad for Currency Input on iOS Apr 9, 2026
@Arbab1308
Copy link
Copy Markdown
Author

/ok-to-test

@Arbab1308
Copy link
Copy Markdown
Author

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27969c03-5685-4697-ac0a-c8a702d705fc

📥 Commits
Reviewing files that changed from the base of the PR and between 5743047 and 45039fd.

📒 Files selected for processing (3)

  • app/client/src/widgets/BaseInputWidget/component/index.tsx
  • app/client/src/widgets/BaseInputWidget/constants.ts
  • app/client/src/widgets/CurrencyInputWidget/component/index.tsx
 ______________________________________________________________________________________________________________________
< You can't write perfect software. Software can't be perfect. Protect your code and users from the inevitable errors. >
 ----------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

✨ Finishing Touches
🧪 Generate unit tests (beta)

  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can enable review details to help with troubleshooting, context usage and more.

/ok-to-test

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Tip

For best results, initiate chat on the files or code changes.

@Arbab1308 The /ok-to-test command has been noted — this will trigger the CI test suite for the PR. Once the test results are in, feel free to ping me if you'd like a follow-up review or have any questions about the changes!


🧠 Learnings used
Learnt from: CR
Repo: appsmithorg/appsmith PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2026-04-07T08:42:07.003Z
Learning: Applies to app/client/playwright/tests/**/*.spec.ts : Test data values (assertion values like "Bangladesh") stay inline. Only strings that change when the app changes are constants.

Learnt from: salevine
Repo: appsmithorg/appsmith PR: 41590
File: appsmith-api-diag.ps1:188-217
Timestamp: 2026-03-05T01:34:25.895Z
Learning: In the Appsmith repository (PR `#41590`), the files `appsmith-api-diag.ps1` and `appsmith-api-diag.sh` are diagnostic/planning artifacts only — not production code. Do not raise code review issues on these files.

Learnt from: CR
Repo: appsmithorg/appsmith PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2026-04-07T08:42:07.003Z
Learning: Before merging new specs, run `yarn test:pw:flake-check --grep "test name"` to verify test stability (runs 5x).

Learnt from: sharat87
Repo: appsmithorg/appsmith PR: 30252
File: deploy/docker/fs/usr/lib/python3/dist-packages/supervisor/appsmith_supervisor_stdout.py:21-29
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The user has confirmed that the suggested changes to handle potential exceptions and improve the robustness of the `main` function in `appsmith_supervisor_stdout.py` are acceptable.

Learnt from: riodeuno
Repo: appsmithorg/appsmith PR: 35088
File: app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/index.ts:133-133
Timestamp: 2024-07-24T19:20:03.017Z
Learning: Ensure to provide feedback on redundant double-negation issues (e.g., `!!isMainCanvas`) earlier in the review process to avoid late-stage changes.

Learnt from: riodeuno
Repo: appsmithorg/appsmith PR: 35088
File: app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/index.ts:133-133
Timestamp: 2024-10-08T15:32:34.114Z
Learning: Ensure to provide feedback on redundant double-negation issues (e.g., `!!isMainCanvas`) earlier in the review process to avoid late-stage changes.

Learnt from: ashit-rath
Repo: appsmithorg/appsmith PR: 37912
File: app/client/src/git/components/QuickActions/helpers.ts:22-25
Timestamp: 2024-12-03T10:13:43.282Z
Learning: In `app/client/src/git/components/QuickActions/helpers.ts`, the unnecessary `ts-ignore` comments will be removed in future PRs.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/client/src/widgets/BaseInputWidget/component/index.tsx (1)

503-523: Use InputMode enum in getInputMode to prevent string drift.

Line 508 can return InputMode | undefined and map via enum members instead of raw strings.

Proposed refactor
-import { InputTypes } from "../constants";
+import { InputMode, InputTypes } from "../constants";
...
-  getInputMode(inputType: InputHTMLType = "TEXT"): string | undefined {
+  getInputMode(inputType: InputHTMLType = "TEXT"): InputMode | undefined {
     switch (inputType) {
       case "NUMBER":
-        return "decimal";
+        return InputMode.DECIMAL;
       case "TEL":
-        return "tel";
+        return InputMode.TEL;
       case "EMAIL":
-        return "email";
+        return InputMode.EMAIL;
       default:
         return undefined;
     }
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/client/src/widgets/BaseInputWidget/component/index.tsx` around lines 503
- 523, The getInputMode function currently returns raw strings; change its
signature to return InputMode | undefined (instead of string | undefined) and
map InputHTMLType cases to the corresponding InputMode enum members (e.g.,
return InputMode.Decimal for "NUMBER", InputMode.Tel for "TEL", InputMode.Email
for "EMAIL"), leaving default as undefined; update any imports/usages to
reference the InputMode enum and ensure InputHTMLType is still the switch
discriminant in the getInputMode method.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/client/src/widgets/BaseInputWidget/component/index.tsx`:
- Around line 503-523: The getInputMode function currently returns raw strings;
change its signature to return InputMode | undefined (instead of string |
undefined) and map InputHTMLType cases to the corresponding InputMode enum
members (e.g., return InputMode.Decimal for "NUMBER", InputMode.Tel for "TEL",
InputMode.Email for "EMAIL"), leaving default as undefined; update any
imports/usages to reference the InputMode enum and ensure InputHTMLType is still
the switch discriminant in the getInputMode method.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27969c03-5685-4697-ac0a-c8a702d705fc

📥 Commits

Reviewing files that changed from the base of the PR and between 5743047 and 45039fd.

📒 Files selected for processing (3)
  • app/client/src/widgets/BaseInputWidget/component/index.tsx
  • app/client/src/widgets/BaseInputWidget/constants.ts
  • app/client/src/widgets/CurrencyInputWidget/component/index.tsx

@Arbab1308
Copy link
Copy Markdown
Author

Hi maintainers, could you please approve the pending workflows for this fork PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Currency Input should open numeric keypad on iOS (inputmode/type missing)

1 participant