protected override void UpdateTarget(TextFieldInfo textFieldInfo)
        {
            if (!Target.IsFocused)
            {
                return;
            }

            var formattedText = textFieldInfo.GetSpannableText();

            if (Target.TextFormatted.Length() == formattedText.Length())
            {
                return;
            }

            Target.TextFormatted = formattedText;
            Target.SetSelection(textFieldInfo.CursorPosition);
        }
Esempio n. 2
0
        protected override void UpdateTarget(TextFieldInfo textFieldInfo)
        {
            if (!Target.IsFocused)
            {
                return;
            }

            var formattedText = textFieldInfo.GetSpannableText();

            if (formattedText.ToString() == Target.TextFormatted?.ToString())
            {
                return;
            }

            lastKnownPosition          = Target.SelectionStart;
            shouldUseLastKnownPosition = isProbablyEditingTokenRegion(textFieldInfo.Text);
            Target.TextFormatted       = formattedText;
            Target.SetSelection(textFieldInfo.CursorPosition);
        }