-
Notifications
You must be signed in to change notification settings - Fork 705
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
Fix regressions with NumberBox HeaderPresenter behavior #2148
Fix regressions with NumberBox HeaderPresenter behavior #2148
Conversation
* Fix issue with header taking up space when not specified/null * Add NumberBox header test * Add log comments for test * Fix behavior of empty string * Update test
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@chingucoding the latest test pass has all the numberbox tests timing out. if you look at the log in the artifacts it looks like all the tests are failing due to a null ref exception and getting so many retries that the work item times out. |
Yeah somehow setting the UIA name of the header of the "TestNumberBox" broke those tests. Reverted it, so it should work now. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Currently the logic to determine header visibility is duplicated in both void OnApplyTemplate()
{
...
m_headerPresenter = null; // In case the control template was changed
UpdateHeaderPresenterState();
...
}
void UpdateHeaderPresenterState()
{
bool showHeader;
if (HeaderTemplate != null)
{
showHeader = true;
}
else
{
var header = Header;
showHeader = header != null && (header is not empty string);
}
if (showHeader && m_headerPresenter == null)
{
m_headerPresenter = GetTemplateChild(...);
}
if (m_headerPresenter != null)
{
m_headerPresenter.Visibility = showHeader ? Visibility.Visible : Visibility.Collapsed;
}
} |
@Kinnara That's a great idea! I've updated the code. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
hmm @chingucoding looks like a test got broken down level |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I'm trying to devine your downlevel issue, without actually debugging, it. I wonder if the mouse wheel input is missing numBox, unfortunately I can't look at what this helper actually does.. maybe you could try to treewalk into a part and mouse wheel on that instead. =/ Refers to: dev/NumberBox/InteractionTests/NumberBoxTests.cs:335 in e64dc76. [](commit_id = e64dc76, deletion_comment = False) |
First of all thank you for your help! My guess would have been, that this test fails because like we noticed on other tests, there simply are differences on how VisualTree helper work and how we can get elements. So maybe this is an issue with that? Though I have to admit, it's a bit unsettling that it just pops up now, now that we hide/show the header presenter :/ I will try to check if we could use a different UIA element to fire the event on. Hopefully that helps. |
So we can also send the events directly to the TextBox contained inside the NumberBox template. Maybe this will fix the test failures on some versions. |
/azp run |
Commenter does not have sufficient privileges for PR 2148 in repo microsoft/microsoft-ui-xaml |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I think one of us just has to spend the time getting this failure under the debugger to see whats going on. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -316,14 +316,14 @@ public void ScrollTest() | |||
|
|||
FindTextBox(numBox).SetFocus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marcel, can you try adding a WaitForIdle here after setting focus ? From the test failure in downlevel, the verify with the value of 2 is failing with value of 0 which might be because the mouse wheel events are going before focus is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, merged with master and added a wait after setting focus.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Looks like NumberBoxTests.ScrollTest is failing on RS4 and below. I will take a look. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
The cause of the test failure was due to the fact that the test ui did not fully fit in the window. The test machines all run at 1024x768. For the NumberBox test page, the test UI was getting squeezed off the screen. On RS5 it just barely fit, but on RS4 it was fully off the screen. I've fixed the issue by switching the Orientation of the TextBox. |
Oh I see. That's good to know. Thank you so much for fixing this! |
Description
Fixes the following regressions:
Motivation and Context
Fixes the regressions listed above as mentioned in these comments
How Has This Been Tested?
Add new interaction tests
Screenshots (if appropriate):