diff --git a/change/react-native-windows-2020-05-13-12-47-43-tabfocus-fix.json b/change/react-native-windows-2020-05-13-12-47-43-tabfocus-fix.json new file mode 100644 index 00000000000..4953f7b7584 --- /dev/null +++ b/change/react-native-windows-2020-05-13-12-47-43-tabfocus-fix.json @@ -0,0 +1,8 @@ +{ + "type": "patch", + "comment": "revert dfc57fcf2504f57baab20f550b36a618eaa99e56", + "packageName": "react-native-windows", + "email": "kmelmon@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-05-13T19:47:43.325Z" +} diff --git a/vnext/ReactUWP/Views/ControlViewManager.cpp b/vnext/ReactUWP/Views/ControlViewManager.cpp index e0bbc4fc1e4..94d073d33cc 100644 --- a/vnext/ReactUWP/Views/ControlViewManager.cpp +++ b/vnext/ReactUWP/Views/ControlViewManager.cpp @@ -64,15 +64,9 @@ void ControlViewManager::UpdateProperties(ShadowNodeBase *nodeToUpdate, const fo } else if (propertyName == "tabIndex") { if (propertyValue.isNumber()) { auto tabIndex = propertyValue.asDouble(); - if (tabIndex == static_cast(tabIndex)) { - if (tabIndex < 0) { - control.IsTabStop(false); - control.ClearValue(winrt::Control::TabIndexProperty()); - } else { - control.IsTabStop(true); - control.TabIndex(static_cast(tabIndex)); - } - } + if (tabIndex == static_cast(tabIndex)) + control.ClearValue(winrt::Control::TabIndexProperty()); + control.TabIndex(static_cast(tabIndex)); } else if (propertyValue.isNull()) { control.ClearValue(winrt::Control::TabIndexProperty()); } diff --git a/vnext/ReactUWP/Views/ViewViewManager.cpp b/vnext/ReactUWP/Views/ViewViewManager.cpp index 1a19bb24260..f69ac00d8c1 100644 --- a/vnext/ReactUWP/Views/ViewViewManager.cpp +++ b/vnext/ReactUWP/Views/ViewViewManager.cpp @@ -87,15 +87,8 @@ class ViewShadowNode : public ShadowNodeBase { void TabIndex(int32_t tabIndex) { m_tabIndex = tabIndex; - if (IsControl()) { - if (tabIndex < 0) { - GetControl().IsTabStop(false); - GetControl().ClearValue(winrt::Control::TabIndexProperty()); - } else { - GetControl().IsTabStop(true); - GetControl().TabIndex(tabIndex); - } - } + if (IsControl()) + GetControl().TabIndex(m_tabIndex); } bool OnClick() { @@ -213,7 +206,7 @@ class ViewShadowNode : public ShadowNodeBase { bool m_enableFocusRing = true; bool m_onClick = false; - int32_t m_tabIndex = -1; + int32_t m_tabIndex = std::numeric_limits::max(); winrt::ContentControl::GotFocus_revoker m_contentControlGotFocusRevoker{}; winrt::ContentControl::LostFocus_revoker m_contentControlLostFocusRevoker{}; @@ -380,7 +373,7 @@ void ViewViewManager::UpdateProperties(ShadowNodeBase *nodeToUpdate, const folly pViewShadowNode->TabIndex(static_cast(tabIndex)); } } else if (propertyValue.isNull()) { - pViewShadowNode->TabIndex(-1); + pViewShadowNode->TabIndex(std::numeric_limits::max()); } } }