Title: Add support for more keyboard types · Issue #3303 · NativeScript/NativeScript · GitHub
Open Graph Title: Add support for more keyboard types · Issue #3303 · NativeScript/NativeScript
X Title: Add support for more keyboard types · Issue #3303 · NativeScript/NativeScript
Description: Hi folks, I'm not only submitting this issue as a feature request, but also as "poor mans documentation" offering a solution to others looking for a similar issue. I'm developing an app where I want the user to be able to enter a PIN cod...
Open Graph Description: Hi folks, I'm not only submitting this issue as a feature request, but also as "poor mans documentation" offering a solution to others looking for a similar issue. I'm developing an app where I wan...
X Description: Hi folks, I'm not only submitting this issue as a feature request, but also as "poor mans documentation" offering a solution to others looking for a similar issue. I'm developing ...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/3303
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add support for more keyboard types","articleBody":"Hi folks,\r\n\r\n\u003e I'm not only submitting this issue as a feature request, but also as \"poor mans documentation\" offering a solution to others looking for a similar issue.\r\n\r\nI'm developing an app where I want the user to be able to enter a PIN code, so only numbers. I thought I'd use the `number` keyboard type on Android and `phone` on iOS. Android is fine, but I wanted to get rid of the characters in the lower left corner on iOS:\r\n\r\n\r\n\r\nSince the {N} [KeyboardType enum](https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/enums/enums.d.ts#L8-L38) doesn't contain the `numberPad` type I did this ({N}-Angular):\r\n\r\n```js\r\n@ViewChild(\"pincodeField\") pincodeField: ElementRef;\r\nthis.pincodeField.nativeElement.ios.keyboardType = Constants.IOS_KEYBOARD_TYPES.numberPad;\r\n```\r\n\r\nWhere `Constants.IOS_KEYBOARD_TYPES.numberPad` is just a custom property that resolves to [4](https://developer.apple.com/reference/uikit/uikeyboardtype/1624444-numberpad).\r\n\r\nThis gives me a nice and clean PIN entry keyboard 🎉\r\n\r\n\r\n\r\n\r\nNote that there's also a sweet `decimalPad`, constant value is [8](https://developer.apple.com/reference/uikit/uikeyboardtype/1624452-decimalpad) which renders this keyboard which I'm using for entering fractions (like payments):\r\n\r\n\r\n\r\n\r\nWouldn't it be nice if I can use this to achieve the same thing?\r\n\r\n```html\r\n\u003cTextField #pincodeField keyboardType=\"numberPad\"\u003e\u003c/TextField\u003e\r\n\u003cTextField #amountField keyboardType=\"decimalPad\"\u003e\u003c/TextField\u003e\r\n```\r\n\r\nSurely these properties are iOS-specific but differentiating between iOS and Android is quite easy in {N}'s views anyway. Or we can tie the `[keyboardType]=\"keyboardType\"` to a property of the component. We can also just use the closest Android keyboard so users don't even need to bother specifying that seperaterly.\r\n\r\nThanks for considering!\r\nEddy\r\n\r\n\u003cbountysource-plugin\u003e\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40111181-add-support-for-more-keyboard-types?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github).\r\n\u003c/bountysource-plugin\u003e","author":{"url":"https://github.com/EddyVerbruggen","@type":"Person","name":"EddyVerbruggen"},"datePublished":"2016-12-15T20:04:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/3303/NativeScript/issues/3303"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cdf7b989-219a-4435-17bb-35ffe1c8592c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD18:321922:A56317:D485C6:697455C3 |
| html-safe-nonce | 1346a455a265c1a5e53ef1352591f044052aedf5f28c748b0f063f7e324b2e03 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDE4OjMyMTkyMjpBNTYzMTc6RDQ4NUM2OjY5NzQ1NUMzIiwidmlzaXRvcl9pZCI6Ijc2MzExMDMwODY0NzAzODcxMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d4b658ced385b6c3c363a1d369882bad864f8806b94d729ddd23fd955d6d6edb |
| hovercard-subject-tag | issue:195902626 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/3303/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4e41854cf59deb10de88b99f5b713c3f534e6957786dd7e20f7d38cd5b514130/NativeScript/NativeScript/issues/3303 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e41854cf59deb10de88b99f5b713c3f534e6957786dd7e20f7d38cd5b514130/NativeScript/NativeScript/issues/3303 |
| og:image:alt | Hi folks, I'm not only submitting this issue as a feature request, but also as "poor mans documentation" offering a solution to others looking for a similar issue. I'm developing an app where I wan... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EddyVerbruggen |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width