Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2373403002: views: update textfield cursor state after programmatic text changes (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 4642d23fc89a89633cc84ff72fbb5011959a7b9d..3819c48cb3afec87c2e5950b350617e43addc332 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -307,6 +307,7 @@ void Textfield::SetTextInputFlags(int flags) {
void Textfield::SetText(const base::string16& new_text) {
model_->SetText(new_text);
OnCaretBoundsChanged();
+ UpdateAfterChange(true, true);
Peter Kasting 2016/09/28 18:56:47 UpdateAfterChange() calls OnCaretBoundsChanged(),
Elly Fong-Jones 2016/10/03 17:37:30 Done.
SchedulePaint();
NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true);
}
@@ -316,6 +317,7 @@ void Textfield::AppendText(const base::string16& new_text) {
return;
model_->Append(new_text);
OnCaretBoundsChanged();
+ UpdateAfterChange(true, true);
Peter Kasting 2016/09/28 18:56:47 The next two functions now trigger accessibility n
Elly Fong-Jones 2016/10/03 17:37:30 I don't know. There are several screenreaders, all
SchedulePaint();
}
@@ -324,6 +326,7 @@ void Textfield::InsertOrReplaceText(const base::string16& new_text) {
return;
model_->InsertText(new_text);
OnCaretBoundsChanged();
+ UpdateAfterChange(true, true);
SchedulePaint();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698