Skip to content

Update #message width to keep from running off right edge of narrow s…#66

Open
kupietools wants to merge 2 commits intoindieweb:mainfrom
kupietools:main
Open

Update #message width to keep from running off right edge of narrow s…#66
kupietools wants to merge 2 commits intoindieweb:mainfrom
kupietools:main

Conversation

@kupietools
Copy link

@kupietools kupietools commented Dec 22, 2024

In indieweb chat, on my small very old iPhone, the input#message element, where you type in messages to submit to chat, is wider than the screen. This makes it difficult to, at times, impossible to see the end of what you're typing, as in iOS you can't even scroll the input field if you can't drag-select all the way to the right edge of it, and that's past the right edge of the screen on my phone.

By changing the max-width of input#message to 95vw, the input field will always be 95% of the width of the browser window at most, whatever that might be.

N.B. Using 95vw as the width causes problems at wide widths due to the pop-out channel sidebar taking up a lot of the window's width and pushing the input off the right edge of the screen even though may be very wide because 95vw is so big at those widths. But because 400px is usually under 95vw, the 95vw limit only takes priority when the window is so narrow that it's below the breakpoint where the pop-out sidebar is automatically collapsed, so there's no problem in that case.

@kupietools kupietools marked this pull request as draft December 22, 2024 01:06
Just changing the width didn't account for problems when the sidebar is showing.
@kupietools kupietools marked this pull request as ready for review December 22, 2024 01:22
@gRegorLove
Copy link
Member

Thanks for submitting this and sorry for the delay!

This looks like it mostly works when I test in Chrome dev tools, though I think a slight overflow is still caused due to the padding on #chat-footer, its 100% width, and its fixed positioning (or some combination of those). Removing the padding on #chat-footer "fixes" it, though isn't the solution I'd propose.

#message {
font-size: 15px;
width: 400px;
max-width: 95vw;
Copy link

Choose a reason for hiding this comment

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

I might add a box-sizing: border-box because if this gets laid out differently (which I would do but that would be more extensive changes). Already the sizing of the container elements #chat and #chat-footer are too wide as well, and don't resize appropriately based on whether the left sidebar is present. I'd probably fix that next. But this is a band-aid that'll work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants