Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(textfield): textarea actually grows with multiline #4271

Merged
merged 22 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
325c63c
fix(textfield): textarea actually grows with multiline
blunteshwar Apr 16, 2024
ed72b31
chore(textfield): added a test
blunteshwar Apr 16, 2024
162d18c
chore(textfield): css changes
blunteshwar Apr 22, 2024
ebcc6cd
chore(textfield): added changes to css
blunteshwar Apr 22, 2024
ad095a3
Update textfield.test.ts
blunteshwar Apr 22, 2024
890b245
Merge branch 'main' into blunteshwar/sp-textarea-bug
blunteshwar Apr 22, 2024
75ad1a2
Merge branch 'blunteshwar/sp-textarea-bug' of github.com:adobe/spectr…
blunteshwar Apr 22, 2024
d19dd75
chore(textfield): reverting css changes as they didn't work
blunteshwar Apr 23, 2024
46291c5
fix(textfield): added css fix
blunteshwar Apr 24, 2024
8f5662c
fix(textfield): fixed the extra spacing in render method
blunteshwar Apr 25, 2024
06c62ef
Merge branch 'main' into blunteshwar/sp-textarea-bug
blunteshwar Apr 25, 2024
110357e
fix(textfield): fixed spacing
blunteshwar Apr 25, 2024
297951b
Merge branch 'blunteshwar/sp-textarea-bug' of github.com:adobe/spectr…
blunteshwar Apr 25, 2024
bf12223
fix(textfield): fixed spacing
blunteshwar Apr 25, 2024
2deb51f
fix(textfield): fixed spacing
blunteshwar Apr 25, 2024
c47912d
fix(textfield): fix spacing
blunteshwar Apr 25, 2024
983257c
fix(textfield): fixed spacing
blunteshwar Apr 25, 2024
ea7494c
fix(textfield): fixed spacing inside render method
blunteshwar Apr 25, 2024
73bf789
Merge branch 'main' into blunteshwar/sp-textarea-bug
blunteshwar Apr 25, 2024
c43707b
chore(textfield): suggested changes
blunteshwar Apr 25, 2024
f245bd4
chore(textfield): removed unrequired css props
blunteshwar Apr 25, 2024
821f542
Merge branch 'blunteshwar/sp-textarea-bug' of github.com:adobe/spectr…
blunteshwar Apr 25, 2024
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
4 changes: 3 additions & 1 deletion packages/textfield/src/textfield.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,7 @@ textarea {
left: 0;
height: 100%;
resize: none;
overflow: hidden;
white-space: pre-line;
min-height: max-content;
overflow: clip;
Westbrook marked this conversation as resolved.
Show resolved Hide resolved
}
28 changes: 28 additions & 0 deletions packages/textfield/test/textfield.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,34 @@ describe('Textfield', () => {
: null;
expect(sizer).to.be.null;
});
it('multiline with grows actually grow', async () => {
const el = await litFixture<Textfield>(
html`
<sp-textfield
placeholder="Enter your name"
multiline
grows
></sp-textfield>
`
);
expect(el).to.not.equal(undefined);
const textArea = el.shadowRoot.querySelector('textarea');
expect(textArea).to.not.be.null;
if (textArea) {
const initialHeight = textArea.offsetHeight;
el.focus();
el.select();
for (let i = 0; i < 100; i++) {
await sendKeys({
type: 'ab',
});
await sendKeys({ press: 'Enter' });
}
const finalHeight = textArea.offsetHeight;
expect(initialHeight).to.not.equal(finalHeight);
blunteshwar marked this conversation as resolved.
Show resolved Hide resolved
}
});

it('valid', async () => {
const el = await litFixture<Textfield>(
html`
Expand Down
Loading