Skip to content

Commit

Permalink
Merge branch 'master' into feature/241-cookie-banner-remove-template
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-storm committed Oct 10, 2024
2 parents 489c436 + 7ed78bf commit 61b89bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/textarea/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stormid/textarea",
"version": "1.0.0-alpha.7",
"version": "1.0.0-alpha.8",
"description": "Auto-resizing textarea",
"author": "stormid",
"license": "MIT",
Expand Down
6 changes: 4 additions & 2 deletions packages/textarea/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { getSelection } from './lib/utils';
const isHidden = el => el.offsetParent === null;

const update = ({ target }) => {
target.style.height = 'auto';
target.style.height = `${target.scrollHeight}px`;
const scrollCache = window.scrollY;
target.style.height = 'auto';
target.style.height = `${target.scrollHeight}px`;
window.scrollTo(0, scrollCache);
};
const initObserver = el => {
const observer = new MutationObserver(mutationsList => {
Expand Down

0 comments on commit 61b89bc

Please sign in to comment.