diff --git a/vnext/CHANGELOG.md b/vnext/CHANGELOG.md index f6795265ba7..78c07a0ea77 100644 --- a/vnext/CHANGELOG.md +++ b/vnext/CHANGELOG.md @@ -445,7 +445,7 @@ Fri, 01 Feb 2019 21:37:51 GMT - Make react-native-win not depend on sdx-platform build scripts - uwp - Add back pressed event firing from View temporarily -- uwp - update SDK dependency to RS5, runtime target RS3+, permissive- +- uwp - update SDK dependency to RS5, runtime target RS2+, permissive- - Add popup component for uwp - autosync - V8 Inspector diff --git a/vnext/PropertySheets/React.Cpp.props b/vnext/PropertySheets/React.Cpp.props index e9d78ae5771..b0e8b272c71 100644 --- a/vnext/PropertySheets/React.Cpp.props +++ b/vnext/PropertySheets/React.Cpp.props @@ -1,12 +1,12 @@ - + en-US 14.0 - + 10.0.17763.0 - 10.0.16299.0 + 10.0.15063.0 diff --git a/vnext/ReactUWP/Views/TextInputViewManager.cpp b/vnext/ReactUWP/Views/TextInputViewManager.cpp index 69ea565a5f3..cd143a5e01f 100644 --- a/vnext/ReactUWP/Views/TextInputViewManager.cpp +++ b/vnext/ReactUWP/Views/TextInputViewManager.cpp @@ -167,25 +167,28 @@ void TextInputShadowNode::createView() }); } - textBox.CharacterReceived([=](auto&&, winrt::CharacterReceivedRoutedEventArgs const& args) { - auto instance = wkinstance.lock(); - std::string key; - wchar_t s[2] = L" "; - s[0] = args.Character(); - key = facebook::react::UnicodeConversion::Utf16ToUtf8(s, 1); + if (textBox.try_as()) + { + textBox.CharacterReceived([=](auto&&, winrt::CharacterReceivedRoutedEventArgs const& args) { + auto instance = wkinstance.lock(); + std::string key; + wchar_t s[2] = L" "; + s[0] = args.Character(); + key = facebook::react::UnicodeConversion::Utf16ToUtf8(s, 1); - if (key.compare("\r") == 0) { - key = "Enter"; - } - else if (key.compare("\b") == 0) { - key = "Backspace"; - } + if (key.compare("\r") == 0) { + key = "Enter"; + } + else if (key.compare("\b") == 0) { + key = "Backspace"; + } - if (!m_updating && instance != nullptr) { - folly::dynamic eventData = folly::dynamic::object("target", tag)("key", folly::dynamic(key)); - instance->DispatchEvent(tag, "topTextInputKeyPress", std::move(eventData)); - } - }); + if (!m_updating && instance != nullptr) { + folly::dynamic eventData = folly::dynamic::object("target", tag)("key", folly::dynamic(key)); + instance->DispatchEvent(tag, "topTextInputKeyPress", std::move(eventData)); + } + }); + } } void TextInputShadowNode::updateProperties(const folly::dynamic&& props) { @@ -251,10 +254,13 @@ void TextInputShadowNode::updateProperties(const folly::dynamic&& props) } else if (pair.first == "placeholderTextColor") { - if (pair.second.isInt()) - textBox.PlaceholderForeground(SolidColorBrushFrom(pair.second)); - else if (pair.second.isNull()) - textBox.ClearValue(winrt::TextBox::PlaceholderForegroundProperty()); + if (textBox.try_as()) + { + if (pair.second.isInt()) + textBox.PlaceholderForeground(SolidColorBrushFrom(pair.second)); + else if (pair.second.isNull()) + textBox.ClearValue(winrt::TextBox::PlaceholderForegroundProperty()); + } } else if (pair.first == "scrollEnabled") {