Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/react-core/src/components/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ class TextAreaBase extends Component<TextAreaProps> {
const parent = field.parentElement;
parent.style.setProperty('height', 'inherit');
const computed = window.getComputedStyle(field);
const parentComputed = window.getComputedStyle(parent);
// Calculate the height
const height =
parseInt(computed.getPropertyValue('border-top-width')) +
parseInt(computed.getPropertyValue('padding-top')) +
field.scrollHeight +
parseInt(computed.getPropertyValue('padding-bottom')) +
parseInt(computed.getPropertyValue('border-bottom-width'));
parseInt(computed.getPropertyValue('border-bottom-width')) +
parseInt(parentComputed.getPropertyValue('padding-top')) +
parseInt(parentComputed.getPropertyValue('padding-bottom'));

parent.style.setProperty('height', `${height}px`);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`Matches the snapshot 1`] = `
<DocumentFragment>
<span
class="pf-v6-c-form-control pf-m-textarea pf-m-resize-both pf-m-disabled custom class"
style="height: 6px;"
style="height: inherit;"
>
<textarea
aria-invalid="false"
Expand Down
Loading