-
Notifications
You must be signed in to change notification settings - Fork 703
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
client: re-focus input on chat form submit #483
Conversation
The whole focusing thing needs to be reworked, but I guess it will do for now. Have you tried how this change reacts on mobile? |
Great analysis, thanks @maxpoulin64! |
I'd prefer for this to land too, however the virtual keyboard is definitely not something we want to ship. Currently lounge avoids opening it by doing this:
which is not ideal to say the least. |
Per @maxpoulin64 and @xPaw's comments above, can we do s/ Thoughts? |
bf54b1a
to
aabdf56
Compare
@maxpoulin64, @xPaw, I just saw that @williamboman updated his PR accordingly. Are you ok with that now? I haven't tested yet btw. |
I'll try to give this a quick try tomorrow as I don't really remember what was the issue and why it was so complicated. |
@maxpoulin64, issue was mobile keyboard was being a bitch. Now this PR doesn't affect mobile anymore so let's |
I think I found a fix for opening the virtual keyboard (also removes the screen width test): function focus() {
if (chat.find(".active").hasClass("chan")) {
input
.attr("readonly", true)
.focus()
.removeAttr("readonly");
}
} |
Holy 🐮, what the hell is that! By the way, is the problem Android-only or does iOS have the same issue? |
@xPaw, regardless of this attempt to make it work on mobile, can we merge that PR? It still is an issue on desktop :-/ |
Thats a pretty common way of hacking something to do a specific thing without triggering something you c don't want to. I certainly want to merge a full fix (because on my phone the keyboard opens whenever I switch channels). |
Agreed this needs fixing, but the full fix you are referring to is not a direct comparison to what this PR is fixing: not re-focusing (on desktop only, for now) after clicking on the submit button. My point is: What is preventing us to merge this PR, for the issue it's trying to solve, and apply your fix/find an optimal fix in a different PR, for that different issue we are having? |
I wanted to open a PR with that fix but testing it is not very conclusive :(
Ah, this is frustrating. I'm starting to think we're better off writing a function based on awful assumptions: if there is a sudden decrease/increase in height but not in width of the window, then keyboard was opened/closed... EDIT: Even worse with Basically, |
@astorije could check if the input is already focused, unsure needs testing. Merging this anyway. |
…-submit client: re-focus input on chat form submit
Closes #481