From a186be1da6eeaffa630067f2fe4960f18a7b9702 Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Thu, 16 Apr 2026 00:00:00 +0100 Subject: [PATCH] Disable macOS auto-capitalisation on all text inputs Added MutationObserver in utils.js that sets autocapitalize=none, autocorrect=off, and spellcheck=false on every input and textarea, including dynamically created ones (profile editor, SFTP modals, etc). --- frontend/src/css/tokens.css | 11 +++++++++++ frontend/src/js/settings.js | 3 +-- frontend/src/js/utils.js | 28 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/frontend/src/css/tokens.css b/frontend/src/css/tokens.css index e98a741..1085982 100644 --- a/frontend/src/css/tokens.css +++ b/frontend/src/css/tokens.css @@ -139,3 +139,14 @@ --toolbar-height: 40px; --status-bar-height: 24px; } + +/* ----------------------------------------------------------------------- + Global input overrides — disable macOS/WebKit auto-capitalisation, + autocorrect, and spellcheck on all text fields. + ----------------------------------------------------------------------- */ +input, textarea, select { + autocapitalize: none; + autocorrect: off; + spellcheck: false; + text-transform: none; +} diff --git a/frontend/src/js/settings.js b/frontend/src/js/settings.js index 8b6ec1c..1e6c0da 100644 --- a/frontend/src/js/settings.js +++ b/frontend/src/js/settings.js @@ -362,11 +362,10 @@ class Settings {

Nexus Terminal

Version 1.0.0

-

A premium desktop SSH, Telnet, and RAW TCP client built with Wails.

+

Developed by Andy Dixon - www.dixon.cx/nexus

diff --git a/frontend/src/js/utils.js b/frontend/src/js/utils.js index 23afdc4..1c75249 100644 --- a/frontend/src/js/utils.js +++ b/frontend/src/js/utils.js @@ -259,4 +259,32 @@ function stateLabel(state) { window.NexusTerminal = window.NexusTerminal || {}; Object.assign(window.NexusTerminal, { $, $$, createElement, escapeHtml, formatTimestamp, debounce, fuzzyMatch, base64Encode, base64Decode, generateId, formatBytes, truncate, dismissContextMenus, protocolColour, stateLabel, relativeTime }); +/* ── Disable macOS/WebKit auto-capitalisation on all text inputs ───────── */ +function disableAutoCapitalise(el) { + el.setAttribute('autocapitalize', 'none'); + el.setAttribute('autocorrect', 'off'); + el.setAttribute('spellcheck', 'false'); +} + +// Apply to existing inputs +document.querySelectorAll('input, textarea').forEach(disableAutoCapitalise); + +// Observe for dynamically added inputs +var inputObserver = new MutationObserver(function(mutations) { + for (var i = 0; i < mutations.length; i++) { + var nodes = mutations[i].addedNodes; + for (var j = 0; j < nodes.length; j++) { + var node = nodes[j]; + if (node.nodeType !== 1) continue; + if (node.tagName === 'INPUT' || node.tagName === 'TEXTAREA') { + disableAutoCapitalise(node); + } + if (node.querySelectorAll) { + node.querySelectorAll('input, textarea').forEach(disableAutoCapitalise); + } + } + } +}); +inputObserver.observe(document.body, { childList: true, subtree: true }); + })();