Bug 652958 - FormHelper autocomplete does not work well with IME compositions [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2011-05-14 12:28:11 +02:00
parent a9ea2d4e29
commit fe3ceabe09

View File

@ -256,6 +256,14 @@ FormAssistant.prototype = {
}
case "FormAssist:AutoComplete": {
try {
currentElement = currentElement.QueryInterface(Ci.nsIDOMNSEditableElement);
let imeEditor = currentElement.editor.QueryInterface(Ci.nsIEditorIMESupport);
if (imeEditor.composing)
imeEditor.forceCompositionEnd();
}
catch(e) {}
currentElement.value = json.value;
let event = currentElement.ownerDocument.createEvent("Events");