• Resolved adriandambrine

    (@adriandambrine)


    Hi,

    There is an automatic scroll when several text based answers questions are set on a quiz. The screen automatically scroll from the first text based answer to the next. How can I correct that ?

    Thank you

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Harmonic Design

    (@harmonic_design)

    Hi adriandambrine,
    I am unable to replicate this on your site using Chrome, Chromium, Firefox, or Epiphany (same render engine as Safari) on either Linux or Windows.

    Right now, I have two guesses.

    First, are you pressing ENTER or TAB? Enter is used to “submit” an input, while TAB will always automatically select and focus the next available input. This is not an HD Quiz thing – this is how forms work on browsers. For example, if you reload the page and keep pressing TAB, you will see each possible input highlight and the page automatically scroll that input into view.

    If the issue is not that you are tabbing inputs, then my best guess is that this is OS/browser related behaviour. Whatever setup you have probably forces (note: it is NOT HD Quiz doing this. It’s your browser) the next text input on ENTER key even though this is only ever supposed to happen if you press the TAB key.

    If this is the case, the only recommendations I can provide are:

    1. Try a different browser. If the issue does not occur in other browsers then we at least know that the issue is specific to your default browser.
    2. Check your list of browser extensions. Maybe it is a browser extension that is forcing this behaviour for you

    Hope this all makes sense and at least helps point us in the right direction!

    Thread Starter adriandambrine

    (@adriandambrine)

    Thank you for your comprehensive answer.

    This issue appear on android phones, on chrome, edge or opera (or facebook browser).

    I tried it on a safari brower on iphone, it does not happen.

    Plugin Author Harmonic Design

    (@harmonic_design)

    This was one of the weirdest rabbit holes I’ve been down in a while.

    So first, I’ve been unable to fully track down where this code/logic is coming from on your site, but I’m 99% sure that this is the issue. You can skip to the end if you don’t care about the explanation.

    For mobile, there is an open HTML standard called enterkeyhint that tells mobile browsers which keyboard to open when an input field is focused. It’s mainly used for things like opening up the “number only” keyboard if the input takes in numbers only.

    What I’m pretty sure is happening on your site is that some other plugin, or perhaps your theme, is setting all inputs to set the enterkeyhint value to next. What this means is that when you press the ENTER key, the browser auto focuses the next available input. Super useful on mobile for things like filling out forms – not desirable at all for something like a quiz.

    How to fix

    You will need to make a super small edit to the plugin files. But the good news is that if we confirm this works for you, then this is something I can actually include in HD Quiz directly so that if any other/future users ever have the same issue – well it won’t be an issue 🙂

    If you edit ./hd-quiz/includes/templates/text.php on line 33 you will see where the text input is printed out. If you add the following just before the closing /> the issue should be fixed for you. The code to add is enterkeyhint="done".

    If this still does not work, then it means that whatever script is running on your site that sets this to next is far more aggressive than I thought – but we still have a couple options to try if it comes to that.

    Please A) let me know if you need help doing the above, and B) please let me know if it works!

    Thread Starter adriandambrine

    (@adriandambrine)

    Before all, thank you for your answer.

    I does seem to work ! You are brilliant.

    I’ll warn you if there is something defaulting

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Automatic scrolling / text based answer’ is closed to new replies.