Skip to content

Commit

Permalink
chore: revert autoresize of text area
Browse files Browse the repository at this point in the history
Related to #372 (comment)
  • Loading branch information
jarekdanielak committed Jul 16, 2024
1 parent 834d0a9 commit 2f3cfb0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion src/components/entries/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function TextArea(props) {

useLayoutEffect(() => {
autoResize && resizeToContents(ref.current);
});
}, []);

useEffect(() => {
if (value === localValue) {
Expand Down
32 changes: 0 additions & 32 deletions test/spec/components/TextArea.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { act } from 'preact/test-utils';
import {
render
} from '@testing-library/preact/pure';
import { waitFor } from '@testing-library/dom';

import TestContainer from 'mocha-test-container-support';

Expand Down Expand Up @@ -491,37 +490,6 @@ GEHTS
});


it('should resize when container display toggles', function() {

// given
const result = createTextArea({
container,
id: 'textarea',
autoResize: true
});

const input = domQuery('.bio-properties-panel-input', result.container);
const initialHeight = input.clientHeight;

// when
container.style.display = 'none';
changeInput(input, 'foo\nbar\nbar\nbar');
const hiddenHeight = input.clientHeight;

// then
expect(hiddenHeight).to.be.eq(0);

// when
container.style.display = 'block';
const visibleHeight = input.clientHeight;

// then
waitFor(() => {
expect(visibleHeight).to.be.greaterThan(initialHeight);
});
});


it('should NOT resize on single line input when initially was display: none', function() {

// given
Expand Down

0 comments on commit 2f3cfb0

Please sign in to comment.