private void onTextFieldInfo(TextFieldInfo textFieldInfo)
        {
            isUpdatingDescriptionField          = true;
            var(attributedText, cursorPosition) = textFieldInfo.AsAttributedTextAndCursorPosition();

            DescriptionTextView.AttributedText = attributedText;

            var positionToSet = DescriptionTextView.GetPosition(DescriptionTextView.BeginningOfDocument, cursorPosition);

            DescriptionTextView.SelectedTextRange = DescriptionTextView.GetTextRange(positionToSet, positionToSet);
            updatePlaceholder();
            isUpdatingDescriptionField = false;
        }
Пример #2
0
        private void onTextFieldInfo(TextFieldInfo textFieldInfo)
        {
            var (attributedText, cursorPosition) = textFieldInfo.AsAttributedTextAndCursorPosition();
            if (DescriptionTextView.AttributedText.GetHashCode() == attributedText.GetHashCode())
                return;

            DescriptionTextView.InputDelegate = emptyInputDelegate; //This line is needed for when the user selects from suggestion and the iOS autocorrect is ready to add text at the same time. Without this line both will happen.
            DescriptionTextView.AttributedText = attributedText;
            var positionToSet =
                DescriptionTextView.GetPosition(DescriptionTextView.BeginningOfDocument, cursorPosition);
            DescriptionTextView.SelectedTextRange = DescriptionTextView.GetTextRange(positionToSet, positionToSet);

            updatePlaceholder();
        }