Page 1 of 1
Datepicker forces page jump
Posted: 05 Feb 2015
by Kti
Hi
Then a user click on a datepicker field the calender is displayed and the browser jumps to the top of page. If have tried to remove the href attribute from the anchor tag, add return false, prevent default, all without luck.
Is there anyway I can resolve this, because it's very frustrating for the users.
Re: Datepicker forces page jump
Posted: 06 Feb 2015
by Dmitry Kozlov
Hi,
Unfortunately, I cannot reproduce the issue, the calendar appears without page jumps. Is it the out-of-the-box date picker or you use a custom one? Have you tried to reproduce the issue on another form? Please, open the browser console and make sure that no errors appear when you open the calendar.
Re: Datepicker forces page jump
Posted: 15 Jun 2017
by chris.cook
Hello Dmitry.
I've also come across this issue.
I've got experience in this, it only occurs in some browsers, and is due to the 'a' tag with an href property of #. Some browsers interpret this as an anchor to the top of the page, while others ignore it.
It is not a good way to implement this feature due to this browser inconsistency.
Safari on iPad and Chrome on android and windows 10 are examples of browsers which treat <a href="#"></a> as an anchor to the top of the page.
Since the functionality is bound to the element using the onclick property, simply changing from an a tag to a div or span and removing the href would solve the issue and retain all current functionality.
Re: Datepicker forces page jump
Posted: 15 Jun 2017
by Dmitry Kozlov
Hi Chris,
Please, try our replacement of default date and time pickers that should be much more user-friendly especially on mobile devices:
https://spform.com/custom-fields/proper ... kers-dates