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).
This commit is contained in:
@@ -139,3 +139,14 @@
|
|||||||
--toolbar-height: 40px;
|
--toolbar-height: 40px;
|
||||||
--status-bar-height: 24px;
|
--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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -362,11 +362,10 @@ class Settings {
|
|||||||
<div class="about-section">
|
<div class="about-section">
|
||||||
<h3 class="about-title">Nexus Terminal</h3>
|
<h3 class="about-title">Nexus Terminal</h3>
|
||||||
<p class="about-version">Version 1.0.0</p>
|
<p class="about-version">Version 1.0.0</p>
|
||||||
<p class="about-desc">A premium desktop SSH, Telnet, and RAW TCP client built with Wails.</p>
|
<p class="about-desc">Developed by Andy Dixon - www.dixon.cx/nexus</p>
|
||||||
<div class="about-links">
|
<div class="about-links">
|
||||||
<p>AES-256-GCM encrypted credential vault</p>
|
<p>AES-256-GCM encrypted credential vault</p>
|
||||||
<p>Platform-native keychain integration</p>
|
<p>Platform-native keychain integration</p>
|
||||||
<p>xterm.js terminal emulation</p>
|
|
||||||
<p>SFTP file browser and transfer</p>
|
<p>SFTP file browser and transfer</p>
|
||||||
<p>Session recording and playback</p>
|
<p>Session recording and playback</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -259,4 +259,32 @@ function stateLabel(state) {
|
|||||||
window.NexusTerminal = window.NexusTerminal || {};
|
window.NexusTerminal = window.NexusTerminal || {};
|
||||||
Object.assign(window.NexusTerminal, { $, $$, createElement, escapeHtml, formatTimestamp, debounce, fuzzyMatch, base64Encode, base64Decode, generateId, formatBytes, truncate, dismissContextMenus, protocolColour, stateLabel, relativeTime });
|
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 });
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user