diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index ec9640588..4bc312c44 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -797,6 +797,7 @@ void HistoryWidget::supportInitAutocomplete() { void HistoryWidget::supportInsertText(const QString &text) { _field->setFocus(); _field->textCursor().insertText(text); + _field->ensureCursorVisible(); } void HistoryWidget::supportShareContact(Support::Contact contact) { diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp index 2dd172773..47956e9ab 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp @@ -2464,6 +2464,10 @@ void InputField::clearFocus() { _inner->clearFocus(); } +void InputField::ensureCursorVisible() { + _inner->ensureCursorVisible(); +} + not_null InputField::rawTextEdit() { return _inner.get(); } diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.h b/Telegram/SourceFiles/ui/widgets/input_fields.h index 61b4dc552..efa6dccc6 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.h +++ b/Telegram/SourceFiles/ui/widgets/input_fields.h @@ -284,6 +284,7 @@ public: bool hasFocus() const; void setFocus(); void clearFocus(); + void ensureCursorVisible(); not_null rawTextEdit(); not_null rawTextEdit() const;