Skip to content

Commit 3b7071b

Browse files
committed
update test file
1 parent fda51af commit 3b7071b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

demos/react-managed-form-custom/body.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,20 @@
7070
function lockBodyScroll(lock) {
7171
var tag = document.querySelector('.container'); // the child element of body that contains the long content
7272
if (!tag) return;
73-
if (!document.scrollingElement) {
74-
alert('Please use newer browser!', document.body.scrollTop);
75-
return;
76-
}
73+
var elem = document.scrollingElement || document.body;
7774
if (!tag.classList) {
7875
alert('Use newer browser!');
7976
return;
8077
}
8178
if (lock) {
82-
var scrollTop = document.scrollingElement.scrollTop;
79+
var scrollTop = elem.scrollTop;
8380
tag.classList.add('no-scroll');
8481
tag.style.top = '-' + scrollTop + 'px';
8582
} else {
8683
var top = tag.offsetTop;
8784
tag.classList.remove('no-scroll');
8885
tag.style.top = '0px';
89-
document.scrollingElement.scrollTop = - top;
86+
elem.scrollTop = - top;
9087
}
9188
}
9289
</script>

0 commit comments

Comments
 (0)