Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support multiline for EditableText #2683
feat: support multiline for EditableText #2683
Changes from 19 commits
edb0a8f
ba0691d
3cf410b
4aac9b0
884570f
0a560dd
fb6e211
701c3a7
9eb4a4e
cbb1812
0440768
61a9790
5431d50
dd72841
2e29cde
f7aace2
7be9a14
c2210dc
3c6e3b9
a4c5cb6
f9269c4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thought, looks like the only difference in the dimensions is 2px, and there's no difference in paddings/line heights etc between the different variants, so looks like doing just:
setInputHeight(textarea.scrollHeight + 2);
works exactly the same and it can save the getComputeStyle and the other calculations incalculateTextareaHeightAttrs
(which already have some default static numbers). Giving itauto
in the beginning will already make it take the the currect box size. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually the question gets back to you :)
technically its only 2px because the border-top/bottom-width is 1px (or 2px overall)
border-box should have included the border as well as the padding, but it doesn't
do we want to just rely on always having this border/padding setting and that the user cannot add anything on their own using overwriting css?
@talkor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it is border-box, it's just that
scrollHeight
is based purely on the content and padding of the element's scrollable content, without the borders.We don't want users to override CSS as it can make design inconsistent so I wouldn't take it into consideration, generally speaking we support the variants we officially provide so it's ok :)
@gabriel-amram