Skip to content

Commit aa8c9f3

Browse files
authored
Fix the autofocus behavior
In some cases autofocus don't work as expected because of wrong padding top. This change fix this issue.
1 parent 74b21eb commit aa8c9f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/kioskboard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@
736736
var docTop = window.document.documentElement.scrollTop || 0;
737737
var inputThreshold = isPlacementTop ? (theInput.clientHeight + 20) : 50;
738738
var theInputOffsetTop = Math.round(inputTop + docTop) - inputThreshold;
739-
var isPaddingTop = theInputOffsetTop < keyboardHeight;
739+
var isPaddingTop = (theInputOffsetTop < keyboardHeight) && isPlacementTop;
740740
var isPaddingBottom = documentHeight <= (theInputOffsetTop + keyboardHeight);
741741

742742
if (isPaddingTop || isPaddingBottom) {

0 commit comments

Comments
 (0)