Attempt to fix a possible crash in InputField.

This commit is contained in:
John Preston 2021-09-01 18:50:00 +03:00
parent 2e3eef52f7
commit ec3af38ad9

View file

@ -1295,7 +1295,6 @@ InputField::InputField(
, _lastTextWithTags(value)
, _placeholderFull(std::move(placeholder)) {
_inner->setDocument(CreateChild<InputDocument>(_inner.get(), _st));
_inner->setAcceptRichText(false);
resize(_st.width, _minHeight);
@ -2976,7 +2975,7 @@ void InputField::inputMethodEventInner(QInputMethodEvent *e) {
const auto weak = Ui::MakeWeak(this);
_inner->QTextEdit::inputMethodEvent(e);
if (weak) {
if (weak && _inputMethodCommit.has_value()) {
const auto text = *base::take(_inputMethodCommit);
if (!processMarkdownReplaces(text)) {
processInstantReplaces(text);