-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TextInput): Support auto-grow for TextInput (#1532)
The best way to support variable size TextInput is with the auto-grow property. This PR updates the JS for the TextInput component and adds the necessary changes to support auto-grow on UWP. Towards #272
- Loading branch information
Showing
12 changed files
with
744 additions
and
301 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
ReactWindows/ReactNative.Shared/Views/TextInput/ReactTextInputContentSizeChangedEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Newtonsoft.Json.Linq; | ||
using ReactNative.UIManager.Events; | ||
|
||
namespace ReactNative.Views.TextInput | ||
{ | ||
class ReactTextInputContentSizeChangedEvent : Event | ||
{ | ||
private readonly double _width; | ||
private readonly double _height; | ||
|
||
public ReactTextInputContentSizeChangedEvent( | ||
int viewTag, | ||
double width, | ||
double height) | ||
: base(viewTag) | ||
{ | ||
_height = height; | ||
_width = width; | ||
} | ||
|
||
public override string EventName | ||
{ | ||
get | ||
{ | ||
return "topContentSizeChange"; | ||
} | ||
} | ||
|
||
public override void Dispatch(RCTEventEmitter eventEmitter) | ||
{ | ||
eventEmitter.receiveEvent(ViewTag, EventName, new JObject | ||
{ | ||
{ "target", ViewTag }, | ||
{ | ||
"contentSize", | ||
new JObject | ||
{ | ||
{ "width", _width }, | ||
{ "height", _height }, | ||
} | ||
}, | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.