-
Notifications
You must be signed in to change notification settings - Fork 2
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 Alpine.js and Tailwind for Textarea size #117
Use Alpine.js and Tailwind for Textarea size #117
Conversation
SimonLab
commented
Aug 3, 2022
- Adjust height of textarea automatically
- use Tailwind to add a max-height
- Adjust height of textarea automatically - use Tailwind to add a max-height
@@ -6,13 +6,22 @@ | |||
<textarea | |||
class="w-full py-1 px-1 text-slate-800 text-3xl | |||
bg-white bg-clip-padding | |||
resize-none | |||
max-h-80 |
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.
see https://tailwindcss.com/docs/max-height
I've also added resize-none
to disable the manually resize UI
transition ease-in-out | ||
border border-b border-slate-200 | ||
focus:border-none focus:outline-none" | ||
name="text" | ||
placeholder="What needs to be done?" | ||
autofocus="" | ||
required="required" | ||
x-data="{resize() { |
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.
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.
@SimonLab this looks good. Going to try it on localhost
now. 🤞
Please mirror to https://github.com/dwyl/learn-alpine.js as a standalone example. e.g: |