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

Unified Diff: Source/core/html/shadow/DateTimeNumericFieldElement.cpp

Issue 191293011: Value set in onblur should not keep element in focus (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review updates Created 6 years, 9 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 | « Source/core/html/shadow/DateTimeNumericFieldElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/DateTimeNumericFieldElement.cpp
diff --git a/Source/core/html/shadow/DateTimeNumericFieldElement.cpp b/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
index 569d72e7961002ab94ad648b6d7abe43f716b35a..4825d7b52f28c46e7c0163771ea200385730c96a 100644
--- a/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
@@ -91,13 +91,15 @@ int DateTimeNumericFieldElement::defaultValueForStepUp() const
return m_range.minimum;
}
-void DateTimeNumericFieldElement::didBlur()
+void DateTimeNumericFieldElement::setFocus(bool value)
{
- int value = typeAheadValue();
- m_typeAheadBuffer.clear();
- if (value >= 0)
- setValueAsInteger(value, DispatchEvent);
- DateTimeFieldElement::didBlur();
+ if (!value) {
+ int value = typeAheadValue();
+ m_typeAheadBuffer.clear();
+ if (value >= 0)
+ setValueAsInteger(value, DispatchEvent);
+ }
+ DateTimeFieldElement::setFocus(value);
}
String DateTimeNumericFieldElement::formatValue(int value) const
« no previous file with comments | « Source/core/html/shadow/DateTimeNumericFieldElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698