Skip to content

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

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

fix(frontend): trigger numeric keypad for Currency Input on iOS#41731
Arbab1308 wants to merge 16 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

Automation

/ok-to-test tags="@tag.All"

Summary by CodeRabbit

  • New Features

    • Input fields now trigger context-appropriate mobile keyboards (decimal for numeric/currency, telephone keypad for phone numbers, email keypad for email fields).
  • Tests

    • Added test coverage verifying detection of appropriate mobile keyboard modes.
  • Style

    • Minor formatting tweaks in input rendering markup (no user-visible behavior changes).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds HTML5 inputmode support: an InputMode enum and a getInputMode helper map inputHTMLType (NUMBER, TEL, EMAIL) to inputmode values; the computed inputMode is passed into the text input rendering path. Includes unit tests and a small formatting change.

Changes

Cohort / File(s) Summary
Input Mode Constants
app/client/src/widgets/BaseInputWidget/constants.ts
Introduces exported InputMode enum and adds NONE = "none" to InputTypes.
Base Input Component
app/client/src/widgets/BaseInputWidget/component/index.tsx
Adds getInputMode helper to map inputHTMLTypeinputmode and passes inputMode into Blueprint's InputGroup for text inputs.
Tests
app/client/src/widgets/BaseInputWidget/component/__tests__/getInputMode.test.ts
Adds Jest tests validating mappings: NUMBERDECIMAL, TELTEL, EMAILEMAIL, and unknown types → undefined.
Formatting
app/client/src/widgets/CurrencyInputWidget/component/index.tsx
Minor whitespace/formatting adjustment in JSX near inputHTMLType="NUMBER".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

✨ Small change, big keystroke—soft and keen,
Numbers summon pads where letters had been,
Decimal, tel, email align in tune,
Mobile taps now hum an easier rune,
Keys fall into place beneath the screen.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding inputMode support to trigger the numeric keypad for Currency Input on iOS.
Linked Issues check ✅ Passed The PR successfully implements the core requirement from #41496: adding inputMode support to display the numeric keypad on iOS for Currency Input.
Out of Scope Changes check ✅ Passed All changes are scoped to the inputMode implementation. Whitespace additions in CurrencyInputComponent are minimal and formatting-related.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description covers the main objective (numeric keypad on mobile), what changed, testing approach, and issue reference, but lacks detailed context and motivation as suggested by the template.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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!

@github-actions
Copy link
Copy Markdown

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions Bot added the Stale label Apr 16, 2026
Copy link
Copy Markdown
Contributor

@sebastianiv21 sebastianiv21 left a comment

Choose a reason for hiding this comment

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

Thanks for this fix — the core approach is correct and the InputMode enum is a good infrastructure addition. A couple of things before this is ready to merge:

  1. No unit tests — getInputMode() is a pure mapping function and is straightforward to test. Please add at minimum a test covering NUMBER → "decimal", TEL → "tel", EMAIL → "email", and the default → undefined path.
  2. Branch is out-of-date — please rebase onto release before requesting a re-review.

Comment thread app/client/src/widgets/BaseInputWidget/component/index.tsx Outdated
Comment thread app/client/src/widgets/BaseInputWidget/constants.ts
Comment thread app/client/src/widgets/CurrencyInputWidget/component/index.tsx Outdated
@Arbab1308 Arbab1308 force-pushed the fix/currency-inputmode-clean branch from 45039fd to 39310aa Compare April 25, 2026 19:43
Comment thread app/client/src/widgets/BaseInputWidget/constants.ts
Copy link
Copy Markdown
Author

@Arbab1308 Arbab1308 left a comment

Choose a reason for hiding this comment

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

check this out

Copy link
Copy Markdown
Author

@Arbab1308 Arbab1308 left a comment

Choose a reason for hiding this comment

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

i have pushed these check once again please

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/client/src/widgets/BaseInputWidget/component/_tests_/getInputMode.test.ts`:
- Line 2: The test imports getInputMode as a standalone function but
getInputMode is a method on BaseInputComponent and not exported; fix by either
extracting getInputMode into a standalone exported function (e.g., create a
utility function getInputMode in the same module and export it from index) and
update callers/tests to import it, or update the test to instantiate
BaseInputComponent and call instance.getInputMode; locate the method on the
BaseInputComponent class and either move its logic into a new exported function
or change the test to construct BaseInputComponent before calling getInputMode.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8ecb7fc-01cb-4adb-b4bc-3febc686c8b7

📥 Commits

Reviewing files that changed from the base of the PR and between 39310aa and 05005b5.

📒 Files selected for processing (4)
  • app/client/src/widgets/BaseInputWidget/component/_tests_/getInputMode.test.ts
  • app/client/src/widgets/BaseInputWidget/component/index.tsx
  • app/client/src/widgets/BaseInputWidget/constants.ts
  • app/client/src/widgets/CurrencyInputWidget/component/index.tsx
✅ Files skipped from review due to trivial changes (2)
  • app/client/src/widgets/CurrencyInputWidget/component/index.tsx
  • app/client/src/widgets/BaseInputWidget/constants.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/widgets/BaseInputWidget/component/index.tsx

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/client/src/widgets/BaseInputWidget/component/__tests__/getInputMode.test.ts (1)

17-19: Consider testing the default-parameter path explicitly

Optional: add expect(getInputMode()).toBeUndefined() to lock the no-arg/default behavior in addition to the "TEXT" case.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/client/src/widgets/BaseInputWidget/component/__tests__/getInputMode.test.ts`
around lines 17 - 19, Test coverage misses the no-argument/default path for
getInputMode — add an assertion that calling getInputMode() without arguments
returns undefined. Modify the test in getInputMode.test.ts (the existing
"returns undefined for default/unknown type" case) to include
expect(getInputMode()).toBeUndefined() alongside the existing
expect(getInputMode("TEXT")).toBeUndefined() so the default/no-arg behavior is
locked in.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/client/src/widgets/BaseInputWidget/component/__tests__/getInputMode.test.ts`:
- Line 2: The test importing getInputMode as a named export is failing because
getInputMode is a class method on BaseInputWidget rather than a standalone
export; either export a standalone function getInputMode from index.tsx (move or
wrap BaseInputWidget.prototype.getInputMode into an exported function) and
update the test import, or change the test to import BaseInputWidget,
instantiate (or use a test double) and call its getInputMode method; reference
the getInputMode method and BaseInputWidget class when making the change so the
import and call are consistent.

---

Nitpick comments:
In
`@app/client/src/widgets/BaseInputWidget/component/__tests__/getInputMode.test.ts`:
- Around line 17-19: Test coverage misses the no-argument/default path for
getInputMode — add an assertion that calling getInputMode() without arguments
returns undefined. Modify the test in getInputMode.test.ts (the existing
"returns undefined for default/unknown type" case) to include
expect(getInputMode()).toBeUndefined() alongside the existing
expect(getInputMode("TEXT")).toBeUndefined() so the default/no-arg behavior is
locked in.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1b3104f9-1f99-4d20-b74a-c3454e7a2641

📥 Commits

Reviewing files that changed from the base of the PR and between 05005b5 and c044cb2.

📒 Files selected for processing (1)
  • app/client/src/widgets/BaseInputWidget/component/__tests__/getInputMode.test.ts

@sebastianiv21 sebastianiv21 added the ok-to-test Required label for CI label Apr 28, 2026
@sebastianiv21
Copy link
Copy Markdown
Contributor

@Arbab1308 please fix the quality check errors

@Arbab1308 Arbab1308 requested a review from sebastianiv21 April 28, 2026 17:49
Copy link
Copy Markdown
Contributor

@sebastianiv21 sebastianiv21 left a comment

Choose a reason for hiding this comment

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

There are still linting issues

@github-actions github-actions Bot removed the Stale label Apr 29, 2026
@Arbab1308
Copy link
Copy Markdown
Author

There are still linting issues

i have tried to fix it again can you please check again

@sebastianiv21
Copy link
Copy Markdown
Contributor

There are still linting issues

i have tried to fix it again can you please check again

@Arbab1308 please check the new linting errors

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

Labels

ok-to-test Required label for CI

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)

2 participants