Keyboard loses focus when changing data unit in setup

VERIFIED FIXED

Status

VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: cjones, Assigned: salva)

Tracking

unspecified
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-basecamp:-, b2g18+ fixed)

Details

Attachments

(1 attachment)

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)

Comment 3

6 years ago
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)
Created attachment 705764 [details]
Prevent input lost of focus when switching the Unit
Attachment #705764 - Flags: review?(francisco.jordano)
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
Last Resolved: 6 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.