Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll viewer layoutbug #2859

Merged
merged 13 commits into from
Aug 8, 2019
10 changes: 5 additions & 5 deletions vnext/ReactUWP/Modules/NativeUIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,14 +1011,14 @@ void NativeUIManager::UpdateExtraLayout(int64_t tag) {
if (shadowNode == nullptr)
return;

if (shadowNode->IsExternalLayoutDirty()) {
YGNodeRef yogaNode = GetYogaNode(tag);
if (yogaNode)
shadowNode->DoExtraLayoutPrep(yogaNode);
auto control = shadowNode->GetView().try_as<winrt::Control>();
decrowle marked this conversation as resolved.
Show resolved Hide resolved
if (control != nullptr) {
decrowle marked this conversation as resolved.
Show resolved Hide resolved
control.UpdateLayout();
}

for (int64_t child : shadowNode->m_children)
for (int64_t child : shadowNode->m_children) {
UpdateExtraLayout(child);
}
}

void NativeUIManager::DoLayout() {
Expand Down
16 changes: 0 additions & 16 deletions vnext/ReactUWP/Views/PickerViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class PickerShadowNode : public ShadowNodeBase {
PickerShadowNode();
void createView() override;
void updateProperties(const folly::dynamic &&props) override;
bool IsExternalLayoutDirty() const override {
return m_hasNewItems;
}
void DoExtraLayoutPrep(YGNodeRef yogaNode) override;

private:
void RepopulateItems();
Expand All @@ -40,7 +36,6 @@ class PickerShadowNode : public ShadowNodeBase {

folly::dynamic m_items;
int32_t m_selectedIndex = -1;
bool m_hasNewItems = false;

// FUTURE: remove when we can require RS5+
bool m_isEditableComboboxSupported;
Expand All @@ -55,16 +50,6 @@ PickerShadowNode::PickerShadowNode() : Super() {
L"Windows.UI.Xaml.Controls.ComboBox", L"IsEditableProperty");
}

void PickerShadowNode::DoExtraLayoutPrep(YGNodeRef yogaNode) {
if (!m_hasNewItems)
return;

m_hasNewItems = false;

auto comboBox = GetView().try_as<winrt::ComboBox>();
comboBox.UpdateLayout();
}

void PickerShadowNode::createView() {
Super::createView();
auto combobox = GetView().as<winrt::ComboBox>();
Expand Down Expand Up @@ -167,7 +152,6 @@ void PickerShadowNode::RepopulateItems() {

comboBoxItems.Append(comboboxItem);
}
m_hasNewItems = true;
}
if (m_selectedIndex < static_cast<int32_t>(m_items.size()))
combobox.SelectedIndex(m_selectedIndex);
Expand Down