unwanted zooming and scrolling on tablet

Workarounds and usability notes.

unwanted zooming and scrolling on tablet

Postby John Robin Dove » Wed Jul 07, 2021 9:37 am

Hi Clifton,
I'm getting seriously frustrated with this program. This is really a continuation of my last topic: how to make my program behave correctly on a tablet? For the moment I have limited testing to my own equipment i.e. a small Samsung tablet running Google Chrome for Android. The performance so far has been very dysfunctional. I have spent hours trying to find fixes. I have now more or less eliminated the unwanted appearances of the virtual keyboard. I have made some other progress too. Initially nothing worked because functions were being executed more than once with disastrous consequences. I think this was caused mainly by mousedown and mouseup events so I have taken most of these out and replaced them with click. Have you ever experienced this?

I am now trying to tackle zooming and scrolling problems.

Zooming: when the user fills in an input the whole page is zoomed to a ridiculous extent as described here https://www.dynamo6.com/thoughts/prevent-unwanted-mobile-zooming/ So I first tried setting the fontsize to 16 px but this made no difference. I then tried using the code example at the bottom. Surprisingly it worked! Half of it, that is. The problem is the zoomDisable function works but not the part to re-enable zooming. zoomDisable() does enlarge the size of the TB page somewhat but I could live with that I guess. The problem is, once zooming is disabled it never comes back! I've copied the code here because there were some problems with line-breaks in the original.
Code: Select all
var $objHead = $( 'head' );

// define a function to disable zooming
var zoomDisable = function() {
    $objHead.find( 'meta[name=viewport]' ).remove();
    $objHead.prepend( '<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" />' );
};

// ... and another to re-enable it
var zoomEnable = function() {
    $objHead.find( 'meta[name=viewport]' ).remove();
    $objHead.prepend( '<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1" />');
};

// if the device is an iProduct, apply the fix whenever the users touches an input
if( navigator.userAgent.length && /iPhone|iPad|iPod/i.test( navigator.userAgent ) ) {
    // define as many target fields as your like
    $( ".search-form input, .contact-form input" )
        .on( { 'touchstart' : function() { zoomDisable() } } )
        .on( { 'touchend' : function() { setTimeout( zoomEnable , 500 ) } } );
 }


Scrolling: I cannot understand why when certain pages are loaded into an iframe just when the the tbk object loading is about done, before my xml file is read, the page is scrolled to the right almost out of sight. I fail to find anything in common on the pages where this occurs. Another lesser problem is that when the keyboard pops up it changes the page scroll but does not correct it when it closes but this is not such a big deal.
I need to find a way to make zoomEnable() function as planned. I also wonder if a script like this could not be used to control the scrolling. I'd be grateful for your thoughts.
John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: unwanted zooming and scrolling on tablet

Postby Clifton » Wed Jul 07, 2021 10:17 am

Not having a lot of time at the moment, I would be careful to avoid locking devices down too much. Invariably a device update is going to make your code fail or a newer device will just not play well. I find that less is more. And many users just get used to weird behaviors on their devices. Having said that, I'm wondering what Android version your device is running. Anything older than 6 is not worth the time trying to get compliance. Newer tablets are much more predictable. I have Android devices with version 6, 9, and 10 on them. For the most part, they play pretty good with ToolBook exports and iframes (though I think version 6 is pretty much obsolete now too and should be).

The disappearing content when the page loads may be attributed to the removal of the meta tag for the default zoom level. This may be leaving the device in a quandry as to how to display the content.

Send me a link so I can see the issues on one of my Android devices.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: unwanted zooming and scrolling on tablet

Postby John Robin Dove » Fri Jul 09, 2021 8:57 am

Hi Clifton,
Thank you for your reply. I wish I could just send you a link but it's a bit more complicated than that. As far as I can see the only way you can see what's going on is to actually use the program. With this in mind, I set up an account for a fictitious school and added a teacher account with classes and exercises etc. I tried to do this on the real web server and soon discovered a whole bunch of issues I was unaware of. I sorted most of these out. I find javascript amazingly unreliable. It seems to me that quite often it just fails to execute the code I have written. The usual 'cure' for this is to throw in a few timeouts. I find this unsatisfactory but I haven't found anything better yet. Have you made any progress trying to implement promises? I wonder if these would be a better solution.
There were some other bugs. Some were a result of recent changes I have made but others were nearly as old as the program itself! It all goes to show that it needs to be thoroughly tested by someone other than myself. When I test it I probably subconsciously avoid things that might be a problem.
When I contacted you in January 2014, which is more than 7 years ago now, you told me that everything I had done in VS/VB.NET could be replicated. I'm sure you were right and I'm not disagreeing or complaining, especially as you redesigned parts of the Powerpac to suit my requirements, but I am getting a bit desperate to finish it now.
I would gladly pay you to finish it but I don't think that's either feasible or fair because it would probably take another seven years for you to figure out my crazy systems!
Could you perhaps test it for me and if so how much would that cost? I think some kind of arrangement with Skype would be best. What do think? I know that you are busy at the moment and that I may have to wait a while (but not seven years I hope :-)

Yours sincerely
John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: unwanted zooming and scrolling on tablet

Postby Clifton » Mon Jul 12, 2021 6:19 pm

It would probably be best if we take the rest of this discussion off the forum and figure out how to proceed with testing.
It is ususally best to thoroughly test elements, not everything all at once.
For example:
  • Perform tests on the licensing integrity.
  • Perform tests on language selection, which I'm sure you are likely going to require.
  • Perform tests on application loading.
  • Perform tests on just the login system and related things like the user password recovery system, etc.
  • Perform tests on database integrity from both user and administrator side.
  • Then test the system for adding/deleting users, etc.
  • ... and so on into the actual system of instruction.
I can see where testing this can get a bit comlicated, but the idea is to try and break the application along the way and identify areas where this either happens because of a programming issue, or if because a user or administration does something the program did not expect and there is no contingency to prevent it from happening.

To continue this discussion, just email me at [email protected]
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron