forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RCTTextBox): TextInput functionality for UWP
This cleans up a lot of the behavior for TextInput, but not all of it. The properties that seem to be working are: * autoCorrect * keyboardType * maxLength * onFocus/onBlur * onSelectionChange * onEndEditing * onSubmitEditing * clearTextOnFocus * selectTextOnFocus * placeholder * selectionColor * editable The properties that are not working are: * numberOfLines * password * placeholderTextColor * autoCapitalize We do not yet support formatted children in the TextInput, which will likely require the use of RichEditBox and RTF. The multiline kind of works, but really only when you do some auto-resizing. The focus and blur methods are not working either. Fixes microsoft#96
- Loading branch information
Showing
23 changed files
with
949 additions
and
588 deletions.
There are no files selected for viewing
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
68 changes: 0 additions & 68 deletions
68
ReactNative.Tests/Views/TextInput/ReactTextBoxPropertiesTests.cs
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Facebook.CSSLayout; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace ReactNative.UIManager | ||
{ | ||
abstract class CSSNodeVisitor<T> | ||
{ | ||
public T Visit(CSSNode node) | ||
{ | ||
if (node == null) | ||
{ | ||
throw new ArgumentNullException(nameof(node)); | ||
} | ||
|
||
var n = node.ChildCount; | ||
if (n == 0) | ||
{ | ||
return Make(node, Array.Empty<T>()); | ||
} | ||
else | ||
{ | ||
var children = new List<T>(n); | ||
foreach (var child in node.Children) | ||
{ | ||
children.Add(Visit(child)); | ||
} | ||
|
||
return Make(node, children); | ||
} | ||
} | ||
|
||
protected abstract T Make(CSSNode node, IList<T> children); | ||
} | ||
} |
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,19 @@ | ||
using Windows.UI.Xaml; | ||
|
||
namespace ReactNative.UIManager | ||
{ | ||
/// <summary> | ||
/// Interface for overriding layout behavior for a view. | ||
/// </summary> | ||
public interface ILayoutManager | ||
{ | ||
/// <summary> | ||
/// Updates the layout of the current instance. | ||
/// </summary> | ||
/// <param name="x">The left coordinate.</param> | ||
/// <param name="y">The top coordinate.</param> | ||
/// <param name="width">The layout width.</param> | ||
/// <param name="height">The layout height.</param> | ||
void UpdateLayout(int x, int y, int width, int 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
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.