Skip to content
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

fix(ui-text-area): make focus line follow resized textarea #1794

Merged
Merged
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
4 changes: 2 additions & 2 deletions packages/ui-text-area/src/TextArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class TextArea extends Component<TextAreaProps> {
if (this._highlightRef) {
const entryStyle = window.getComputedStyle(entry.target)
this._highlightRef.style.transition = 'none'
this._highlightRef.style.width = `calc(${entryStyle.width}px + 2.125rem)`
this._highlightRef.style.height = `calc(${entryStyle.height}px + 2.125rem)`
this._highlightRef.style.width = `calc(${entryStyle.width} + 0.5rem)`
Copy link
Contributor Author

@joyenjoyer joyenjoyer Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entryStyle.width is a string, which already has 'px' in it. I removed the unneccessary px string from the calc() function and adjusted the proper rem amount.

this._highlightRef.style.height = `calc(${entryStyle.height} + 0.5rem)`
clearTimeout(this.resizeTimeout)

this.resizeTimeout = setTimeout(() => {
Expand Down
Loading