diff --git a/src/Uno.UI/UI/Xaml/Controls/FocusVisual/SystemFocusVisual.wasm.cs b/src/Uno.UI/UI/Xaml/Controls/FocusVisual/SystemFocusVisual.wasm.cs index 18221569c10e..1b5b4c5e9991 100644 --- a/src/Uno.UI/UI/Xaml/Controls/FocusVisual/SystemFocusVisual.wasm.cs +++ b/src/Uno.UI/UI/Xaml/Controls/FocusVisual/SystemFocusVisual.wasm.cs @@ -39,6 +39,9 @@ partial void DetachVisualPartial() #endif } +#if NET7_0_OR_GREATER + [JSExport] +#endif public static int DispatchNativePositionChange(int focusVisualId) { var element = UIElement.GetElementFromHandle(focusVisualId) as SystemFocusVisual; diff --git a/src/Uno.UI/ts/Windows/UI/Xaml/Input/FocusVisual.ts b/src/Uno.UI/ts/Windows/UI/Xaml/Input/FocusVisual.ts index 2c41d6271848..ba9a11da16e4 100644 --- a/src/Uno.UI/ts/Windows/UI/Xaml/Input/FocusVisual.ts +++ b/src/Uno.UI/ts/Windows/UI/Xaml/Input/FocusVisual.ts @@ -25,8 +25,12 @@ private static onDocumentScroll() { if (!FocusVisual.dispatchPositionChange) { - FocusVisual.dispatchPositionChange = (Module).mono_bind_static_method( - "[Uno.UI] Uno.UI.Xaml.Controls.SystemFocusVisual:DispatchNativePositionChange"); + if ((globalThis).DotnetExports !== undefined) { + FocusVisual.dispatchPositionChange = (globalThis).DotnetExports.UnoUI.Uno.UI.Xaml.Controls.SystemFocusVisual.DispatchNativePositionChange; + } else { + FocusVisual.dispatchPositionChange = (Module).mono_bind_static_method( + "[Uno.UI] Uno.UI.Xaml.Controls.SystemFocusVisual:DispatchNativePositionChange"); + } } FocusVisual.updatePosition();