Closed Bug 582560 Opened 14 years ago Closed 14 years ago

Backspace should not act as back button inside input fields

Categories

(Firefox for Android Graveyard :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(fennec2.0a1+)

VERIFIED FIXED
Tracking Status
fennec 2.0a1+ ---

People

(Reporter: naginenis, Assigned: mfinkle)

Details

Attachments

(1 file)

Sources: latest
mobile-browser: a45829ce508b
mozilla-central: 609d101acf8e

Steps to Reproduce:
1. Start Fennec
2. Open www.ya.ru
3. Open www.google.com in the same tab
4. Tap on google's search field
4. Type "Fennec" in google's search field
5. Press back space button to delete the entered text

Actual Results:
The browser navigated back to the previous page

Expected Results:
Last typed character should be deleted

Reproducible: Always
tracking-fennec: --- → 2.0a1+
Not sure the exact reason but I guess the following change from the rev:8c56aff4fd8e is causing the issue.

--- a/chrome/content/InputHandler.js
+++ b/chrome/content/InputHandler.js
@@ -1158,21 +1158,18 @@ KeyModule.prototype = {
       if (elem.customKeySender)
         break;
     return (elem) ? elem : null;
   },
 
   handleEvent: function handleEvent(evInfo) {
     if (evInfo.event.type == "keydown" || evInfo.event.type == "keyup" || evInfo.event.type == "keypress") {
       let keyer = this._browserViewContainer.customKeySender;
-      if (keyer) {
+      if (keyer)
         keyer.dispatchKeyEvent(evInfo.event);
-        evInfo.event.preventDefault();
-        evInfo.event.stopPropagation();
-      }
     }
   },
 
   /* We don't have much state to reset if we lose event focus */
   cancelPending: function cancelPending() {}
 };
(In reply to comment #1)
> Not sure the exact reason but I guess the following change from the
> rev:8c56aff4fd8e is causing the issue.
> 
> -      if (keyer) {
> +      if (keyer)
>          keyer.dispatchKeyEvent(evInfo.event);
> -        evInfo.event.preventDefault();
> -        evInfo.event.stopPropagation();
> -      }

I made that change because I could not get chrome shortcuts to work. Like CTRL+T to open a new tab.
Let me see if this was the real cause of the problem
Assignee: nobody → mark.finkle
Attached patch patchSplinter Review
OK. The event.stopPropagation() and event.preventDefault() were a red herring. When closing a tab, the focus is messed up somehow. Forcing the focusing back to chrome fixes the bug I was seeing. We need to fix that in a separate bug.

This patch restores the removed code and backspace works correctly again.
Attachment #460948 - Flags: review?(mbrubeck)
Attachment #460948 - Flags: review?(mbrubeck) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Verified fixed on:
Mozilla/5.0 (Android;Linux armv7l;rv:9.0a1)Gecko/20110920
Firefox/9.0a1 Fennec/9.0a1
Device: HTC Desire
OS: Android 2.2
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: