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

How to make textarea auto-resize with Alpine.js #3

Open
2 tasks
nelsonic opened this issue Jul 10, 2022 · 6 comments
Open
2 tasks

How to make textarea auto-resize with Alpine.js #3

nelsonic opened this issue Jul 10, 2022 · 6 comments
Assignees
Labels
discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-1 Highest priority issue. This is costing us money every minute that passes. research Research required; be specific spike The simplest possible experiment to explore potential solutions to a problem T2h Time Estimate 2 Hours technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Jul 10, 2022

At present we have a <textarea> for capturing items in the MVP App:
image

If we input too much text into the <textarea> it starts to scroll which is a poor experience on mobile.

On desktop it kinda works to have a smaller box ...

image

But it would also be nice to tidy up the UX around the input area.

Todo

  • Research how to make the <textarea> resize automatically depending on the content.
  • Should not expand more than the height of the screen minus the keyboard.

Starting point: https://benborgers.com/posts/alpine-textarea-auto-resize + https://youtu.be/z7130uJ3H7w

@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T2h Time Estimate 2 Hours research Research required; be specific discuss Share your constructive thoughts on how to make progress with this issue labels Jul 10, 2022
@nelsonic nelsonic added this to To do in Simon's list via automation Jul 10, 2022
@nelsonic nelsonic added spike The simplest possible experiment to explore potential solutions to a problem technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Jul 10, 2022
@nelsonic
Copy link
Member Author

@SimonLab I don't know if this will take more than T2h ... ⏳ 💭 🤷‍♂️
(if it takes longer, please just update the label ...)
Please record your progress in this thread so everyone understands the code.

Having just watched: "Alpine.js Auto Textarea Height" https://youtu.be/z7130uJ3H7w

image

I feel like we could get a basic version of this working in T25m. 🤞
The tricky part will be the maximum height.
But I think Tailwind max-height should help us with that: https://tailwindcss.com/docs/max-height
Or we can derive it based on the screen height and set that as the limit.

@nelsonic nelsonic added priority-1 Highest priority issue. This is costing us money every minute that passes. and removed priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished labels Jul 22, 2022
@nelsonic
Copy link
Member Author

This UI/UX still bugs me while using the MVP mvp.fly.dev ... 🙄

image

@SimonLab if you want to pair on this today [Friday] please LMK. 🧑‍💻
Would make a good break from working on the README.md ... dwyl/mvp#89 😜

@SimonLab SimonLab moved this from To do to In progress in Simon's list Aug 3, 2022
@SimonLab SimonLab moved this from In progress to Awaiting Feedback/Review in Simon's list Aug 3, 2022
@SimonLab
Copy link
Member

SimonLab commented Aug 3, 2022

I've created the PR dwyl/mvp#117
Let me know if it works for you @nelsonic

@SimonLab SimonLab added the awaiting-review An issue or pull request that needs to be reviewed label Aug 3, 2022
@nelsonic
Copy link
Member Author

nelsonic commented Aug 3, 2022

@SimonLab was hoping that we could create the functionality here first
so that anyone finding this in the future can understand how we solved it.
and .then apply it in the MVP & App. 💭

@SimonLab SimonLab removed the awaiting-review An issue or pull request that needs to be reviewed label Aug 5, 2022
@SimonLab SimonLab moved this from Awaiting Feedback/Review to In progress in Simon's list Aug 5, 2022
@nelsonic
Copy link
Member Author

nelsonic commented Aug 8, 2022

Working on: https://mvp.fly.dev
expanding-textarea

@SimonLab SimonLab moved this from In progress to To do in Simon's list Sep 20, 2022
@nelsonic
Copy link
Member Author

@SimonLab please add a simple example of this in the form of a resizing-textarea.html in this repo project. 🙏
New file called resizing-textarea.html. Linked to from the README.md 🔗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Share your constructive thoughts on how to make progress with this issue enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-1 Highest priority issue. This is costing us money every minute that passes. research Research required; be specific spike The simplest possible experiment to explore potential solutions to a problem T2h Time Estimate 2 Hours technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
Development

No branches or pull requests

2 participants