mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-20 20:18:36 +01:00
kalk_web: Added placeholder
This commit is contained in:
parent
5401415bba
commit
ddd075ef64
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@paddim8/kalk-component",
|
"name": "@paddim8/kalk-component",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.",
|
"description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.",
|
||||||
"svelte": "src/main.ts",
|
"svelte": "src/main.ts",
|
||||||
"main": "public/build/bundle.js",
|
"main": "public/build/bundle.js",
|
||||||
|
@ -56,6 +56,10 @@
|
|||||||
function setHtml(html: string) {
|
function setHtml(html: string) {
|
||||||
highlightedTextElement.innerHTML = html;
|
highlightedTextElement.innerHTML = html;
|
||||||
inputElement.value = highlightedTextElement.textContent;
|
inputElement.value = highlightedTextElement.textContent;
|
||||||
|
|
||||||
|
if (!html) {
|
||||||
|
highlightedTextElement.innerHTML = `<span class='placeholder'>${hinttext}</div>`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHtml(): string {
|
function getHtml(): string {
|
||||||
@ -310,7 +314,9 @@
|
|||||||
class="highlighted-text"
|
class="highlighted-text"
|
||||||
aria-hidden
|
aria-hidden
|
||||||
bind:this={highlightedTextElement}
|
bind:this={highlightedTextElement}
|
||||||
/>
|
>
|
||||||
|
<span class="placeholder">{hinttext}</span>
|
||||||
|
</div>
|
||||||
<textarea
|
<textarea
|
||||||
class="input"
|
class="input"
|
||||||
placeholder={hinttext}
|
placeholder={hinttext}
|
||||||
@ -388,6 +394,10 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
.prompt {
|
.prompt {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user