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
[TextareaAutosize] Fix inline style not getting applied
  • Loading branch information
ZeeshanTamboli committed Mar 10, 2024
commit 3b6e08fd23cac25e9fe979e6cd07e9086c068c6a
Original file line number Diff line number Diff line change
Expand Up @@ -458,4 +458,17 @@ describe('<TextareaAutosize />', () => {
expect(input.style).to.have.property('height', `${lineHeight * 2}px`);
});
});

it('should apply the inline styles using the "style" prop', function test() {
if (/jsdom/.test(window.navigator.userAgent)) {
this.skip();
}

render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />);
const input = document.querySelector<HTMLTextAreaElement>('textarea');

expect(input).toHaveComputedStyle({
backgroundColor: 'rgb(255, 255, 0)',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const TextareaAutosize = React.forwardRef(function TextareaAutosize(
ref={handleRef}
// Apply the rows prop to get a "correct" first SSR paint
rows={minRows as number}
style={style}
{...other}
/>
<textarea
Expand Down