Skip to content

Commit

Permalink
Avoid capitalization on Android.
Browse files Browse the repository at this point in the history
Also avoids ``#query`` id.   Plan to remove all ids, so we can make
the shell embeddable.
  • Loading branch information
JanWielemaker committed Feb 28, 2025
1 parent f1620d5 commit 155442b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/wasm/demos/shell/shell.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ body {
.console.key #keyboard { display : block }
.create-file #create-file { display: inline; }

#query { flex-grow: 1; margin: 0px 10px;}
#input input { flex-grow: 1; margin: 0px 10px;}

#keyboard:focus { outline: 0px; }
#keyboard > span { color: #888; font-style: italic; font-size: 90%; }
Expand Down
5 changes: 3 additions & 2 deletions src/wasm/demos/shell/shell.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
onclick="reply_trace('abort')"></button>
</div>
<div id="input">
<span class="prompt">?- </span><input type="text" name="query"
id="query" autocomplete="off">
<span class="prompt">?- </span><input type="text" name="query"
autocapitalize="none"
autocomplete="off">
</div>
<form class="abort" id="abort">
<button>Abort</button>
Expand Down
8 changes: 4 additions & 4 deletions src/wasm/demos/shell/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function add_query(query)
div2.textContent = `?- ${query}`;
answer = div4;
edit.addEventListener("click", () => {
const queryElem = input.querySelector("#query");
const queryElem = input.querySelector("input");
queryElem.value = query;
queryElem.focus();
});
Expand Down Expand Up @@ -362,7 +362,7 @@ function query(query)
*******************************/

function submitQuery(queryElem)
{ const input = queryElem.querySelector("#query");
{ const input = queryElem.querySelector("input");
let query = input.value;
input.value = '';

Expand All @@ -383,7 +383,7 @@ function submitQuery(queryElem)
}

function focusInput(queryElem, why)
{ const input = queryElem.querySelector("#query");
{ const input = queryElem.querySelector("input");
const prompt = queryElem.querySelector("span.prompt");
switch(why)
{ case "query":
Expand All @@ -402,7 +402,7 @@ function focusInput(queryElem, why)

input.addEventListener("keydown", (event) =>
{ if ( event.key == "Tab" )
{ const elem = input.querySelector("#query");
{ const elem = input.querySelector("input");
const caret = elem.selectionStart;
const all = elem.value;
const before = all.slice(0,caret);
Expand Down

0 comments on commit 155442b

Please sign in to comment.