Closed Bug 826916 Opened 12 years ago Closed 11 years ago

Keyboard loses focus when changing data unit in setup

Categories

(Firefox OS Graveyard :: Gaia::Cost Control, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-basecamp:-, b2g18+ fixed)

VERIFIED FIXED
blocking-basecamp -
Tracking Status
b2g18 + fixed

People

(Reporter: cjones, Assigned: salva)

References

Details

Attachments

(1 file)

STR
 (1) Go through setup
 (2) On "Data usage limit" screen, tap "GB" selector

The keyboard loses focus, but I don't want it to lose focus.

bb? -> radar

NOT A REGRESSION FROM BUG 823619
Has workaround, not blocking. Marking tracking+ for 1.0 fix.
blocking-basecamp: ? → -
tracking-b2g18: --- → +
Assignee: nobody → salva
This is a little bit tricky. It depends on bug #687787 but I'm trying to use `blur` instead but I don't get to stop loosing the focus.

  dataLimitInput.addEventListener('blur',
    function _preventFocusLost(evt) {
      evt.preventDefault();
    }
  );

Can you help me Chris?
Depends on: 687787
Flags: needinfo?(jones.chris.g)
blur happens after the target has lost focus, so preventDefault doesn't make sense.
(bug 687787 is way too risky for b2g-18)
Ok, so I need some event before loosing the focus. If not, I can recover the focus after pressing the button but the result is quite ugly: it looses the focus, the keyboard disappears, then it recovers the focus and the keyboard appears again.
You'll want to follow the SMS app's example

https://github.com/mozilla-b2g/gaia/blob/master/apps/sms/js/sms.js#L705

preventDefault()ing the mousedown on the button seems to do the trick for SMS.
Flags: needinfo?(jones.chris.g)
Comment on attachment 705764 [details]
Prevent input lost of focus when switching the Unit

Bug caused by (feature/regressing bug #): this one
User impact if declined: medium
Testing completed: yes
Risk to taking this patch (and alternatives if risky): very low
Attachment #705764 - Flags: approval-gaia-v1?(francisco.jordano)
Comment on attachment 705764 [details]
Prevent input lost of focus when switching the Unit

Pretty simple change r=me

Thanks for keeping it clean Salva ;)
Attachment #705764 - Flags: review?(francisco.jordano)
Attachment #705764 - Flags: review+
Attachment #705764 - Flags: approval-gaia-v1?(francisco.jordano)
Attachment #705764 - Flags: approval-gaia-v1+
Landed on master:
https://github.com/mozilla-b2g/gaia/commit/197db965f817daf46189bc9b29b8a472f6224257
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Working fine in Gecko-cfad7c9.Gaia-6c53dfd.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: