Topic: Time Picker scroll page top on opening

beachjf pro asked 4 years ago


Is there a way to avoid the TimePicker Scroll to Top of the page when click the text field, Here is an example of what's happening. https://tagtwee.com/en/tptest   Thanks a lot  

beachjf pro answered 4 years ago


Hi, for now, I just comment the code bellow in timepicker.component.ts I don't think you need to focus the field since in order to open the timepicker, you actually need to click on the field already. What do you think ?
//field.setAttribute('style', 'position:absolute; top: 0px; opacity: 0; -webkit-user-modify: read-write-plaintext-only; left:0px;');
document.body.appendChild(field);
/*
// adding onfocus event handler for out temp field
field.onfocus = function () {
// this timeout of 200ms is nessasary for Android 2.3.x
setTimeout(function () {
field.setAttribute('style', 'display:none;');
setTimeout(function () {
document.body.removeChild(field);
document.body.focus();
}, 14);
}, 20);
};
// focusing it
field.focus();
*/

Damian Gemza staff commented 4 years ago

Hello beachjf, Focus on timepicker is needed in situation, when user don't want to use mouse click to open timepicker. He could just tab through form and get opened timepicker. But thanks for your's report. We'll think how to proper fix situation when timepicker is opened and scrollbar appears. Best Regards, Damian


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags