Bug 1275493 - Do not update <select> field while keying through items in dropdown with non-e10s on OS X and GTK. r?Enn
MozReview-Commit-ID: D5PBEj9MMW2
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1311,20 +1311,29 @@ nsListControlFrame::ToggleOptionSelected
// Dispatch event and such
bool
nsListControlFrame::UpdateSelection()
{
if (mIsAllFramesHere) {
// if it's a combobox, display the new text
nsWeakFrame weakFrame(this);
if (mComboboxFrame) {
+#if defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
+ // For GTK and OS X, we do not update the combobox
+ // while the dropdown is open and the user is updating
+ // their selection.
+ if (!mComboboxFrame->IsDroppedDown()) {
+ mComboboxFrame->RedisplaySelectedText();
+ }
+#else
mComboboxFrame->RedisplaySelectedText();
+#endif
- // When dropdown list is open, onchange event will be fired when Enter key
- // is hit or when dropdown list is dismissed.
+ // When dropdown list is open, onchange event will be fired when
+ // Enter key is hit or when dropdown list is dismissed.
if (mComboboxFrame->IsDroppedDown()) {
return weakFrame.IsAlive();
}
}
if (mIsAllContentHere) {
FireOnInputAndOnChange();
}
return weakFrame.IsAlive();