Skip to content

Commit 328a6aa

Browse files
committed
added textInputWithChild; fix #17
1 parent e9baa4a commit 328a6aa

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

src/Fable.Helpers.ReactNative.fs

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,12 @@ module Props =
451451
inherit ITouchableOpacityProperties
452452
inherit ITouchableHighlightProperties
453453

454-
type ITextPropertiesIOS =
455-
interface end
456-
457454
type ITextProperties =
458-
inherit ITextPropertiesIOS
455+
interface end
459456

457+
type ITextInputProperties =
458+
interface end
459+
460460
type IViewProperties =
461461
inherit IViewPropertiesAndroid
462462
inherit IViewPropertiesIOS
@@ -706,7 +706,7 @@ module Props =
706706
type TextPropertiesIOS =
707707
| AllowFontScaling of bool // REQUIRED!
708708
| SuppressHighlighting of bool
709-
interface ITextPropertiesIOS
709+
interface ITextProperties
710710

711711
type TextProperties =
712712
| AllowFontScaling of bool
@@ -719,32 +719,22 @@ module Props =
719719
| Ref of Ref<Text>
720720
interface ITextProperties
721721

722-
type ITextInputIOSProperties =
723-
interface end
724-
725-
type ITextInputAndroidProperties =
726-
interface end
727-
728-
type ITextInputProperties =
729-
inherit ITextInputIOSProperties
730-
inherit ITextInputAndroidProperties
731-
732722
module TextInput =
733723
type TextInputIOSProperties =
734724
| ClearButtonMode of string
735725
| ClearTextOnFocus of bool
736726
| EnablesReturnKeyAutomatically of bool
737727
| OnKeyPress of (unit -> unit)
738728
| SelectionState of obj
739-
interface ITextInputIOSProperties
729+
interface ITextInputProperties
740730

741731
type TextInputAndroidProperties =
742732
| NumberOfLines of float
743733
| ReturnKeyLabel of string
744734
| TextAlign of string
745735
| TextAlignVertical of string
746736
| UnderlineColorAndroid of string
747-
interface ITextInputAndroidProperties
737+
interface ITextInputProperties
748738

749739
type TextInputProperties =
750740
| AutoCapitalize of AutoCapitalize
@@ -1549,6 +1539,7 @@ module Props =
15491539
interface ITouchableNativeFeedbackProperties
15501540
interface ITouchableOpacityProperties
15511541
interface ITextProperties
1542+
interface ITextInputProperties
15521543

15531544
open Props
15541545
module R = Fable.Helpers.React
@@ -1592,12 +1583,14 @@ let inline createElement(c: React.ComponentClass<'T>, props: 'P list, children:
15921583
let inline internal createElementWithObjProps(c: React.ComponentClass<'T>, props: obj, children: React.ReactElement list) =
15931584
R.createElement (c, props, children)
15941585

1595-
let inline text (props:TextProperties list) (text:string): React.ReactElement =
1586+
let inline text (props:ITextProperties list) (text:string): React.ReactElement =
15961587
createElement(RN.Text, props, [React.str text])
15971588

1598-
let inline textInput (props: ITextInputProperties list) (text:string): React.ReactElement =
1599-
let valueProp = TextInput.TextInputProperties.Value text :> ITextInputProperties
1600-
createElement(RN.TextInput, valueProp :: props, [])
1589+
let inline textInput (props: ITextInputProperties list): React.ReactElement =
1590+
createElement(RN.TextInput, props, [])
1591+
1592+
let inline textInputWithChild (props: ITextInputProperties list) (text: string): React.ReactElement =
1593+
createElement(RN.TextInput, props, [React.str text])
16011594

16021595
let inline createToolbarAction(title:string,showStatus:ToolbarActionShowStatus) : ToolbarAndroidAction =
16031596
createObj [

0 commit comments

Comments
 (0)