This is a (multiple allowed):
There is currently a problem when the user clicks on an input at the bottom of the screen. The keyboard gets displayed but it covers the input that the user clicked on. Only when the user starts typing on the keyboard, the input automatically scrolls up and becomes visible above the keyboard.
It would be nice to have Framework7 automatically handles this issue for all users in a similar way to that of the Ionic framework. With Ionic, a specific keyboard plugin is used.
https://github.com/driftyco/ionic-plugin-keyboard
After installing the plugin, the Ionic framework automatically handles the scrolling for inputs which are at the bottom of the screen.
i have this problem now
@seme1 https://github.com/driftyco/ionic-plugin-keyboard how it work?
I used this jQuery plugin to automatically scroll to any input by listening to input onFocus events.
https://github.com/flesler/jquery.scrollTo
This has solved all the problems I faced without the need to use the keyboard plugin. The scrollTo plugin attempts to keep the focused input always near the top of the screen. It would be nice if Framework7 has integrated such a function within (or has the option of enabling/disabling this function by simply adding a certain class name to any input).
Yeah please make that!!!
That would be easy but I have no idea how to make a pull request lol
Fork the repository, code and do a pull request :)
Ok when I get home I'll do it
hey help me out i'm stuck,
give me some example
@bhumin3i @JosephShenton @imac8t @seme1
_if (!myApp.device.ios) {
$$(page.container).find('input, textarea').on('focus', function (event) {
var container = $$(event.target).closest('.page-content');
var elementOffset = $$(event.target).offset().top;
var pageOffset = container.scrollTop();
var newPageOffset = pageOffset + elementOffset - 81;
setTimeout(function () {
container.scrollTop(newPageOffset, 300);
}, 700);
});
}_
@seme1 could you like to share your code that using JQuery.scrollTo. i have some little confusing to using it
Issue is closed because of outdated/irrelevant/not actual
If this issue is still actual and reproducible for latest version of Framework7, please create new issue and fill the issue template correctly:
Most helpful comment
@bhumin3i @JosephShenton @imac8t @seme1
Here my work around (call it after the fields have been loaded):
_if (!myApp.device.ios) {
$$(page.container).find('input, textarea').on('focus', function (event) {
var container = $$(event.target).closest('.page-content');
var elementOffset = $$(event.target).offset().top;
var pageOffset = container.scrollTop();
var newPageOffset = pageOffset + elementOffset - 81;
setTimeout(function () {
container.scrollTop(newPageOffset, 300);
}, 700);
});
}_