We do this in the browser app https://github.com/mozilla-b2g/gaia/blob/master/apps/browser/style/toolbar.css#L57
Its proved fairly fragile and likely to break with homescreen changes and new devices, I do agree that a screen size related solution is best though, we should try not to have apps make assumptions about that keyboard On 12 August 2013 11:23, Julien Wajsberg <[email protected]> wrote: > Le 12/08/2013 11:44, Alive a écrit : > > Interesting, but only Keyboard app knows its actual height, > > and as far as we're introducing 3 party keyboard, there may be a > > 'fullscreen' keyboard implementation. > > > > I am not sure if media query could cover the use case without fail. > > You don't want to use media query to record each keyboard app height > > in your app, right? > > > > So far an app window height is affected by: > > > > 1. Keyboard height (?) > > 2. Statusbar height (2rem to 4rem now) > > 3. Wrapper footer(the navigation UI) height (1rem to 5 or 6rem now) > > 4. Fullscreen state > > 5. Orientation state > > > > I am uncertain if we could judge 'now keyboard is there' from some > > math statement in media query. > > We actually do this in JavaScript in the Messages app (but it's quite > fragile and it broke once already when suggestions get added). > > but what Schlomi said was: > "Viewport getting shrinked and I need to control the UI on this event." > > Therefore, the real question is: "my viewport is shrinked, how can I > detect this ?". Which sounds a lot like media queries to me ;) > > So my proposition was: let's not detect we have a keyboard, let's detect > screen size changes instead (that's what the resize event does too after > all). > > -- > Julien > > _______________________________________________ > dev-b2g mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-b2g > > _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
