Fix focus visuals being obscured by adjacent views.
Before this change, focus visuals for a component were rendered within that component. However, since the visuals are shown outside the components bounds, if there was an adjacent view with no margin and a border or a background, then if that view was higher in the zorder than the focused component, it would obscure the focus visuals.
This fixes that by hoisting the focus visuals up the component tree until we hit a component that can contain the focus visuals within itself.
I also added code to nudge the size of the focus rect down if it doesn't fit inside the window, which prevents the focus visuals of say the RNTester navigation buttons from being cut off by the window.
This change also reduces the size of a normal non-focused view component in memory by extracting various focus related members to a struct that is only created when that view hosts a focus visual. In addition, the root focus visual is not only created when hosting a focus visual, which should greatly reduce the number of visuals created.
Description
Fix focus visuals being obscured by adjacent views.
Before this change, focus visuals for a component were rendered within that component. However, since the visuals are shown outside the components bounds, if there was an adjacent view with no margin and a border or a background, then if that view was higher in the zorder than the focused component, it would obscure the focus visuals.
This fixes that by hoisting the focus visuals up the component tree until we hit a component that can contain the focus visuals within itself.
I also added code to nudge the size of the focus rect down if it doesn't fit inside the window, which prevents the focus visuals of say the RNTester navigation buttons from being cut off by the window.
This change also reduces the size of a normal non-focused view component in memory by extracting various focus related members to a struct that is only created when that view hosts a focus visual. In addition, the root focus visual is not only created when hosting a focus visual, which should greatly reduce the number of visuals created.
Microsoft Reviewers: Open in CodeFlow