diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs index bc91c738cc6f..3542e2586993 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs @@ -1,6 +1,5 @@ using System; using Tizen.UIExtensions.ElmSharp; -using SmartEvent = ElmSharp.SmartEvent; using EEntry = ElmSharp.Entry; namespace Microsoft.Maui.Handlers @@ -21,19 +20,18 @@ protected override Entry CreateNativeView() protected override void ConnectHandler(Entry nativeView) { nativeView.Activated += OnCompleted; - nativeView.CursorChanged += OnCursorChanged; + nativeView.CursorPositionChanged += OnCursorChanged; - // In order to know when the selection is cleared, "selecton,cleared" event has been used. + // In order to know when the selection is cleared, SelectionCleared event has been used. // Because CursorChanged event is still invoked with the selected text when an user clears selection. It is an known issue in EFL. - SmartEvent selectionCleared = new SmartEvent(nativeView, nativeView.RealHandle, ThemeConstants.Entry.Signals.SelectionCleared); - selectionCleared.On += OnSelectionCleared; + nativeView.SelectionCleared += OnSelectionCleared; nativeView.TextChanged += OnTextChanged; nativeView.EntryLayoutFocused += OnFocused; nativeView.EntryLayoutUnfocused += OnUnfocused; - nativeView.PrependMarkUpFilter(MaxLengthFilter); + // TODO: Fix me later // An initial CursorPosition is set after layouting to avoid timing issue when the EditField entry is initialized. //if (VirtualView != null) @@ -48,7 +46,7 @@ protected override void ConnectHandler(Entry nativeView) protected override void DisconnectHandler(Entry nativeView) { nativeView.Activated -= OnCompleted; - nativeView.CursorChanged -= OnCursorChanged; + nativeView.CursorPositionChanged -= OnCursorChanged; nativeView.TextChanged -= OnTextChanged; nativeView.EntryLayoutFocused -= OnFocused; nativeView.EntryLayoutUnfocused -= OnUnfocused; diff --git a/src/Core/src/Platform/Tizen/EntryExtensions.cs b/src/Core/src/Platform/Tizen/EntryExtensions.cs index 1573ebd24c26..f7cf92fdcd07 100644 --- a/src/Core/src/Platform/Tizen/EntryExtensions.cs +++ b/src/Core/src/Platform/Tizen/EntryExtensions.cs @@ -102,6 +102,9 @@ public static void UpdateMaxLength(this Entry nativeEntry, ITextInput entry) [PortHandler] public static void UpdateSelectionLength(this Entry nativeEntry, IEntry entry) { + if (nativeEntry.IsUpdatingCursorPosition) + return; + int start = GetSelectionStart(nativeEntry, entry); int end = GetSelectionEnd(nativeEntry, entry, start);