mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
Do not aggressively focus input when clicking anywhere
This commit is contained in:
parent
9164f65693
commit
7267f89377
2 changed files with 1 additions and 19 deletions
|
@ -223,16 +223,6 @@ $(function() {
|
|||
input.trigger("focus");
|
||||
}
|
||||
};
|
||||
|
||||
$(window).on("focus", focus);
|
||||
|
||||
chat.on("click", ".chat", function() {
|
||||
setTimeout(function() {
|
||||
if (window.getSelection().isCollapsed) {
|
||||
focus();
|
||||
}
|
||||
}, 2);
|
||||
});
|
||||
}
|
||||
|
||||
if (navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)) {
|
||||
|
@ -241,7 +231,7 @@ $(function() {
|
|||
|
||||
$("#form").on("submit", function(e) {
|
||||
e.preventDefault();
|
||||
utils.forceFocus();
|
||||
focus();
|
||||
const target = chat.data("id");
|
||||
const text = input.val();
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
const $ = require("jquery");
|
||||
const escape = require("css.escape");
|
||||
const input = $("#input");
|
||||
const viewport = $("#viewport");
|
||||
|
||||
var serverHash = -1; // eslint-disable-line no-var
|
||||
|
@ -14,7 +13,6 @@ module.exports = {
|
|||
serverHash,
|
||||
lastMessageId,
|
||||
confirmExit,
|
||||
forceFocus,
|
||||
scrollIntoViewNicely,
|
||||
hasRoleInChannel,
|
||||
move,
|
||||
|
@ -54,12 +52,6 @@ function hasRoleInChannel(channel, roles) {
|
|||
return user.parent().is("." + roles.join(", ."));
|
||||
}
|
||||
|
||||
// Triggering click event opens the virtual keyboard on mobile
|
||||
// This can only be called from another interactive event (e.g. button click)
|
||||
function forceFocus() {
|
||||
input.trigger("click").trigger("focus");
|
||||
}
|
||||
|
||||
// Reusable scrollIntoView parameters for channel list / user list
|
||||
function scrollIntoViewNicely(el) {
|
||||
// Ideally this would use behavior: "smooth", but that does not consistently work in e.g. Chrome
|
||||
|
|
Loading…
Reference in a new issue