mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Bug 332811 - Backspace in readonly input triggers history.back() (part 2), r=mats.palmgren, sr=bzbarsky
This commit is contained in:
parent
0a2168427f
commit
2a32a97a87
@ -150,7 +150,14 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
if (flags & nsIPlaintextEditor::eEditorReadonlyMask ||
|
||||
flags & nsIPlaintextEditor::eEditorDisabledMask)
|
||||
{
|
||||
// consume backspace for disabled and readonly textfields, to prevent
|
||||
// back in history, which could be confusing to users
|
||||
if (keyCode == nsIDOMKeyEvent::DOM_VK_BACK_SPACE)
|
||||
aKeyEvent->PreventDefault();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
else
|
||||
return NS_ERROR_FAILURE; // Editor unable to handle this.
|
||||
|
Loading…
x
Reference in New Issue
Block a user