Extremely large textarea
Well, yeah. For some reason, the textarea just keeps growing and growing.
22 Replies
Textarea.tsx
What does the compiled code look like? Not many of us are React devs so seeing the final form will help immensely to troubleshoot what's wrong.
Compiled form?
What's the output look like? That actual HTML and CSS.
Umm should I share the browser DOM?
I am using Nextjs. It doesn't generate the files by default (afaik)
If you can, that would help 😄
The
field-sizing-content might be an issue, but it seems like there is something else at play as well.
(I don't use nextjs, but does it not have an npm build?)
having a preview online would help as wellI, personally, need to see the raw HTML and CSS. All the React and tailwind is making my brain hurt b/c I don't use 'em
Let me see if I can get that
This, yeah. Setup a codepen with the important bits, or pastebin, I think is another option
Ohh wait
GitHub
sage/app/home/interview/[id]/_components at main · ShayokhShorfudd...
AI-powered technical interview preparation platform. 💻 - ShayokhShorfuddin/sage
Here are the 2 files in my repo
Those are the
.tsx files. We need to see the compiled HTML and CSS.oh wait, I found the issue 😄
err, maybe. Something is causing the horizontal overflow, but then you have a
fixed on the div around the textarea. It's not causing the issue, but it's fixed, so it scrolls along with you as you go to the side.
I've had to see a live version of this online so I could poke around in the devtools to figure out more I thinkThat's actually interesting
My goal was to keep this textarea in the center of the right side component
Initially went for position:sticky but that wasn't behaving well
So I thought maybe fixed at the bottom will do
Let me see if I can host this part of the codeabase
fixed is always going to be fixed to the viewport. It also has a w-full on it, which is width: 100%, but that 100% is of the viewport, not anything it's inside of... because with the fixed position, it's not really inside of anything, except the viewport
that might sort of be causing the issue, which is why it's recursively making the window wider... but normally fixed elements won't cause overflow, so that's why I think something else is at play too
As Kevin says clearly something else is going on.
In theory, as your container (containing the textarea and the button) has position fixed, it should stretch across the bottom of the viewport. However, in your video it is offset from the left by the width of the sidebar. Looking at your code I can't work out how/why it is doing that but that may be related 🤔
That said, your github code is not the same as the code in your video so that makes it harder.
Hello
I fixed the large textarea issue. And now I would like to keep it in the center of the section. I tried applying sticky but it's causing extra space at the bottom and also pushes the sidebar above. Tried
fixed which produced output very close to expected output but it takes the full screen width, overlapping the sidebar in the process. Tried absolute which kinda works but gets scrolled away with overflowing section content (doesn't stick at the bottom of the screen as expected)
Here is the expected outcome -