Commit a36d84c 1 parent 6e90171 commit a36d84c Copy full SHA for a36d84c
File tree 2 files changed +15
-2
lines changed
vnext/Microsoft.ReactNative/Utils
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,13 @@ struct CustomAppBarButton : xaml::Controls::AppBarButtonT<CustomAppBarButton> {
30
30
}
31
31
};
32
32
33
- void FixProofingMenuCrashForXamlIsland (xaml::Controls::TextCommandBarFlyout const &flyout) {
33
+ void FixProofingMenuCrashForXamlIsland (xaml::Controls::Primitives::FlyoutBase const &flyout) {
34
34
flyout.Opening ([](winrt::IInspectable const &sender, auto &&) {
35
+ #ifdef USE_WINUI2_CBF
36
+ const auto &flyout = sender.as <winrt::Microsoft::UI::Xaml::Controls::TextCommandBarFlyout>();
37
+ #else
35
38
const auto &flyout = sender.as <xaml::Controls::TextCommandBarFlyout>();
39
+ #endif
36
40
if (const auto &textBox = flyout.Target ().try_as <xaml::Controls::TextBox>()) {
37
41
const auto &commands = flyout.SecondaryCommands ();
38
42
for (uint32_t i = 0 ; i < commands.Size (); ++i) {
Original file line number Diff line number Diff line change 7
7
8
8
#include < UI.Xaml.Controls.Primitives.h>
9
9
#include < UI.Xaml.Controls.h>
10
+ #define USE_WINUI2_CBF
11
+ #ifdef USE_WINUI2_CBF
12
+ #include < winrt/Microsoft.UI.Xaml.Controls.h>
13
+ #endif
10
14
11
15
namespace Microsoft ::ReactNative {
12
16
13
- void FixProofingMenuCrashForXamlIsland (xaml::Controls::TextCommandBarFlyout const &flyout);
17
+ void FixProofingMenuCrashForXamlIsland (xaml::Controls::Primitives::FlyoutBase const &flyout);
14
18
15
19
template <typename T>
16
20
inline void EnsureUniqueTextFlyoutForXamlIsland (T const &textView) {
@@ -19,7 +23,12 @@ inline void EnsureUniqueTextFlyoutForXamlIsland(T const &textView) {
19
23
// to show the flyout on other windows cause the first window to get focus.
20
24
// https://github.com/microsoft/microsoft-ui-xaml/issues/5341
21
25
if (IsXamlIsland ()) {
26
+ #ifdef USE_WINUI2_CBF
27
+ winrt::Microsoft::UI::Xaml::Controls::TextCommandBarFlyout flyout;
28
+ #else
22
29
xaml::Controls::TextCommandBarFlyout flyout;
30
+ #endif
31
+
23
32
flyout.Placement (xaml::Controls::Primitives::FlyoutPlacementMode::BottomEdgeAlignedLeft);
24
33
25
34
// This works around a XAML Islands bug where the Proofing sub-menu for
You can’t perform that action at this time.
0 commit comments