From 8d036ab1d47a9dfe01f69cb4b92bfda89158ab0c Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Thu, 4 Sep 2014 17:44:29 -0700 Subject: [PATCH] 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 --- AppKit/CPTextField.j | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 6ddd3716f..134d65816 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -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