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 Alpine.js and Tailwind for Textarea size #117

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

SimonLab
Copy link
Member

@SimonLab 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
Copy link
Member Author

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() {
Copy link
Member Author

Choose a reason for hiding this comment

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

@SimonLab SimonLab marked this pull request as ready for review August 3, 2022 14:12
@SimonLab SimonLab requested a review from nelsonic August 3, 2022 14:12
@SimonLab SimonLab added the awaiting-review An issue or pull request that needs to be reviewed label Aug 3, 2022
Copy link
Member

@nelsonic nelsonic left a 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. 🤞

@nelsonic
Copy link
Member

nelsonic commented Aug 3, 2022

Please mirror to https://github.com/dwyl/learn-alpine.js as a standalone example. e.g: textarea.html 🙏

@nelsonic nelsonic merged commit 37c5fb6 into phoenix-1.6-2022-refresh-issue-#89 Aug 3, 2022
@nelsonic nelsonic deleted the auto-resize-textarea branch August 3, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants