getgrav / grav-theme-agency

Agency Theme for Grav
https://getgrav.org
MIT License
27 stars 36 forks source link

Fresh install- automatically scrolls to the contact form at the bottom on page load #12

Closed rossity closed 7 years ago

rossity commented 7 years ago

Title- i thought it was something to do with my code but even on a fresh install the page automatically scrolls to the contact form at the bottom when loading/refreshing the page

rossity commented 7 years ago

fixed it by commenting out line 44 in user\plugins\form\templates\forms\default\field.html.twig:

elFani commented 7 years ago

I'm getting the same issue but the line 44 comment isn't working.

Obviously, some sort of bug that with the autfocus of the first form field. Interesting that Grav doesn't have a form on their demo page for this theme...

EDIT: just tried commenting out line 44 again and it worked

EDIT 2: better solution is to just comment/remove autofocus: 'on' in the portfolio.md file. autofocus is turned on in the first field on the fields: list

flaviocopes commented 7 years ago

Your form page header had autofocus enabled on the Name field.

It was the default in the Agency Site skeleton up to now, if you were using that. I just issued an updated which contains a fix from @OleVik https://github.com/getgrav/grav-skeleton-agency-site/commit/2e04ab860b0a1bd4d69b168eadc26f0c0dcc4ddd