fix(frontend): trigger numeric keypad for Currency Input on iOS#41731
fix(frontend): trigger numeric keypad for Currency Input on iOS#41731Arbab1308 wants to merge 3 commits intoappsmithorg:releasefrom
Conversation
WalkthroughThe changes introduce mobile keyboard layout support by adding an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
/ok-to-test |
/ok-to-test |
|
Tip For best results, initiate chat on the files or code changes.
🧠 Learnings used |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/client/src/widgets/BaseInputWidget/component/index.tsx (1)
503-523: UseInputModeenum ingetInputModeto prevent string drift.Line 508 can return
InputMode | undefinedand 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
📒 Files selected for processing (3)
app/client/src/widgets/BaseInputWidget/component/index.tsxapp/client/src/widgets/BaseInputWidget/constants.tsapp/client/src/widgets/CurrencyInputWidget/component/index.tsx
|
Hi maintainers, could you please approve the pending workflows for this fork PR? Thanks! |
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
Testing
Fixes
Summary by CodeRabbit