Bug 1203668 part 1 - Setting the value of a <select> to a non-matching option should deselect all options and set selectedIndex to -1. r=bz
This commit is contained in:
@@ -1148,9 +1148,11 @@ HTMLSelectElement::SetValue(const nsAString& aValue)
|
||||
option->GetValue(optionVal);
|
||||
if (optionVal.Equals(aValue)) {
|
||||
SetSelectedIndexInternal(int32_t(i), true);
|
||||
break;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
// No matching option was found.
|
||||
SetSelectedIndexInternal(-1, true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user