Fixed: backspace on a none editable/enable field trigger the browser's page back button

Previously, when hitting the backspace key on a none editable/enable field, this triggered the browser's back button.
Now it does not anymore.

All credits for @apajarita

Fixed #2189
This commit is contained in:
Alexandre Wilhelm
2014-09-04 17:44:29 -07:00
parent 57f2d3e26a
commit 8d036ab1d4
+3
View File
@@ -981,6 +981,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
- (void)keyDown:(CPEvent)anEvent
{
if (!([self isEnabled] && [self isEditable]))
return;
// CPTextField uses an HTML input element to take the input so we need to
// propagate the dom event so the element is updated. This has to be done
// before interpretKeyEvents: though so individual commands have a chance