-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix XAML Visibility for display:none
#7363
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
Conversation
|
Question: from this snapshot and inspecting component properties from VS, it seems like the visibility remains as "visibile," despite the behavior changing as if it was collapsing(and from setting breakpoints in FrameworkElementViewManager I can see that the right code is getting hit and the Visibility value gets set to "Collapsed" - but I never see this in XAML) - any idea what's going on? |
if the tree dump says it's not collapsed then it's probably not collapsed : ) (and something else may be re-setting the property?) |
packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js
Outdated
Show resolved
Hide resolved
The "collapsed" element is no longer seen in the UI, but the Live Visual Tree and accompanying properties do not seem to change when display:none is toggled. If I undo the code change I added, same thing happens - component goes out of view when display is set to none, but you are still able to tab into those components - when I add the change back in, I'm no longer able to tab into components which are set to display:none, but according to the properties the visibility is still "visible"... |
|
Overall looks good. Just make sure you figure out the xaml dump issue |
|
Also, the JS checks are failing. You need to run |
Will do, I ran |
vnext/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp
Outdated
Show resolved
Hide resolved
|
I've looked in the CI logs, and there are excessive white spaces - you must have run lint:fix earlier but it didn't get committed. |
|
@AgneLukoseviciute looks like the test was removed, was that intentional? |
Yep, I filed an issue(#7392) that will need to get fixed before I could get the tests working. The way the tests search in the e2e app isn't filtering the results down enough, at least in the case of View. |
|
Thanks @AgneLukoseviciute ; in the meantime, can we add the test to a different/new page instead? |
Yep that should work - I'll add it. |
packages/@react-native-windows/tester/src/js/utils/RNTesterList.windows.js
Show resolved
Hide resolved
packages/@react-native-windows/tester/js/examples-win/DisplayNone/.vs/ProjectSettings.json
Outdated
Show resolved
Hide resolved
...ges/@react-native-windows/tester/js/examples-win/DisplayNone/DisplayNoneExample.windows.d.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js
Outdated
Show resolved
Hide resolved
.../@react-native-windows/tester/src/js/examples-win/DisplayNone/DisplayNoneExample.windows.tsx
Outdated
Show resolved
Hide resolved
|
@AgneLukoseviciute Looks like your snapshots are missing the Left/Top attached properties which the tests recently started requiring. Can you rebase your changes onto the latest master and re-generate the snapshot? |
...ages/@react-native-windows/tester/js/examples-win/DisplayNone/DisplayNoneExample.windows.tsx
Outdated
Show resolved
Hide resolved
rectified95
left a comment
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.
Remember to remove the duplicate file
Final comment before merging: Confirmed the elements are getting collapsed through Live Visual Tree and Property panes however the snapshot tests do not reflect this. Might require filing an issue - and if/when this gets fixed this test will fail and will just need updated snapshots to go through. Additionally, I had to hard code the width for the view containing 2 Text and 2 Switch components as there was a weird width mismatch from running locally vs in the CI checks. To confirm the display:none property change was not the cause, I made sure update property for display was not getting hit when the prop was not used and commit a2ea3df confirmed the view width issue persists even when display:none is not used. |
@AgneLukoseviciute: filed #7586 |
As mentioned in #6355, components with display:none still participate in focus and UIA. This adds new logic in FrameworkElementViewManager to change visbility to collapsed when display: is set to none.
I tested the behavior through a new example in RNTester View component page using TextInput to confirm that focus is disabled when display:none.
Fixes #6355, also likely fixes react-navigation #9109.
Microsoft Reviewers: Open in CodeFlow