Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions change/react-native-windows-2020-02-25-11-32-44-tabindex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "prerelease",
"comment": "Set IsTabStop to false when tabIndex is negative",
"packageName": "react-native-windows",
"email": "lamdoan@microsoft.com",
"commit": "27a16dc9783aefa04c5035c4c2a4b39e8d11f6f8",
"dependentChangeType": "patch",
"date": "2020-02-25T19:32:43.976Z"
}
10 changes: 8 additions & 2 deletions vnext/ReactUWP/Views/ControlViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ void ControlViewManager::UpdateProperties(ShadowNodeBase *nodeToUpdate, const fo
} else if (propertyName == "tabIndex") {
if (propertyValue.isNumber()) {
auto tabIndex = propertyValue.asDouble();
if (tabIndex == static_cast<int32_t>(tabIndex))
control.TabIndex(static_cast<int32_t>(tabIndex));
if (tabIndex == static_cast<int32_t>(tabIndex)) {
if (tabIndex < 0) {
control.IsTabStop(false);
Comment thread
lamxdoan marked this conversation as resolved.
} else {
control.IsTabStop(true);
control.TabIndex(static_cast<int32_t>(tabIndex));
}
}
} else if (propertyValue.isNull()) {
control.ClearValue(winrt::Control::TabIndexProperty());
}
Expand Down
10 changes: 8 additions & 2 deletions vnext/ReactUWP/Views/ViewViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ class ViewShadowNode : public ShadowNodeBase {
void TabIndex(int32_t tabIndex) {
m_tabIndex = tabIndex;

if (IsControl())
GetControl().TabIndex(m_tabIndex);
if (IsControl()) {
if (tabIndex < 0) {
GetControl().IsTabStop(false);
Comment thread
lamxdoan marked this conversation as resolved.
} else {
GetControl().IsTabStop(true);
GetControl().TabIndex(tabIndex);
}
}
}

bool OnClick() {
Expand Down