Skip to content

Commit

Permalink
ADD scrollBehavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ttsuru committed Nov 19, 2022
1 parent 8fc6a6d commit d46183c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/autosize.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ function assign(ta) {
const overflows = getParentOverflows(ta);
const docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)

if (docTop) {
document.documentElement.style.scrollBehavior = 'auto';
}

ta.style.height = '';
ta.style.height = (ta.scrollHeight+heightOffset)+'px';

Expand All @@ -121,6 +125,7 @@ function assign(ta) {

if (docTop) {
document.documentElement.scrollTop = docTop;
document.documentElement.style.scrollBehavior = null;
}
}

Expand All @@ -133,7 +138,7 @@ function assign(ta) {
// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;

// The actual height not matching the style height (set via the resize method) indicates that
// The actual height not matching the style height (set via the resize method) indicates that
// the max-height has been exceeded, in which case the overflow should be allowed.
if (actualHeight < styleHeight) {
if (computed.overflowY === 'hidden') {
Expand Down

0 comments on commit d46183c

Please sign in to comment.