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

Use rows #21

Open
fregante opened this issue Jul 22, 2022 · 0 comments
Open

Use rows #21

fregante opened this issue Jul 22, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fregante
Copy link
Owner

As suggested in #17

Unlike now, fit-textarea should start being a little more stateful, like caching the line-height

  1. Use getComputedStyle($0).lineHeight to get the line height on first load
  2. If normal, estimate (with excess) and then detect the height change at the next rows increase
  3. if the scrollHeight is higher than the clientHeight, set the rows attribute to scrollHeight/lineHeight

This would fix #17 permanently.

Note: v3 is deprecated and any work should start on top of v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant