Skip to content

Commit 4967015

Browse files
Lewis ChungMoOx
authored andcommitted
Add autoComplete prop to TextInput (#327)
Add the autoComplete prop into the TextInput component
1 parent b01014c commit 4967015

3 files changed

Lines changed: 95 additions & 1 deletion

File tree

‎lib/js/src/components/textInput.js‎

Lines changed: 42 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/components/textInput.re‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ let make =
3232
~accessibilityViewIsModal=?,
3333
~shouldRasterizeIOS=?,
3434
~autoCapitalize=?,
35+
~autoComplete=?,
3536
~autoCorrect=?,
3637
~autoFocus=?,
3738
~blurOnSubmit=?,
@@ -89,6 +90,24 @@ let make =
8990
| `words => "words"
9091
| `characters => "characters",
9192
),
93+
"autoComplete":
94+
autoComplete
95+
->Belt.Option.map(
96+
fun
97+
| `off => "off"
98+
| `username => "username"
99+
| `password => "password"
100+
| `email => "email"
101+
| `name => "name"
102+
| `tel => "tel"
103+
| `streetAddress => "street-address"
104+
| `postalCode => "postal-code"
105+
| `ccNumber => "cc-number"
106+
| `ccCsc => "cc-csc"
107+
| `ccExp => "cc-exp"
108+
| `ccExpMonth => "cc-exp-month"
109+
| `ccExpYear => "cc-exp-year",
110+
),
92111
"autoCorrect": autoCorrect,
93112
"autoFocus": autoFocus,
94113
"blurOnSubmit": blurOnSubmit,

‎src/components/textInput.rei‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ You can read more on [Text] component usage in official docs: {{:https://faceboo
1515
| `words
1616
]=?
1717
]}
18+
{4 autoComplete}
19+
{[
20+
autoComplete: [<
21+
| `off
22+
| `username
23+
| `password
24+
| `email
25+
| `name
26+
| `tel
27+
| `streetAddress
28+
| `postalCode
29+
| `ccNumber
30+
| `ccCsc
31+
| `ccExp
32+
| `ccExpMonth
33+
| `ccExpYear
34+
]=?
35+
]}
1836
{4 autoCorrect}
1937
{[
2038
~autoCorrect: bool=?
@@ -307,6 +325,22 @@ let make:
307325
~accessibilityViewIsModal: bool=?,
308326
~shouldRasterizeIOS: bool=?,
309327
~autoCapitalize: [< | `characters | `none | `sentences | `words]=?,
328+
~autoComplete: [<
329+
| `off
330+
| `username
331+
| `password
332+
| `email
333+
| `name
334+
| `tel
335+
| `streetAddress
336+
| `postalCode
337+
| `ccNumber
338+
| `ccCsc
339+
| `ccExp
340+
| `ccExpMonth
341+
| `ccExpYear
342+
]
343+
=?,
310344
~autoCorrect: bool=?,
311345
~autoFocus: bool=?,
312346
~blurOnSubmit: bool=?,

0 commit comments

Comments
 (0)