Skip to content

Commit 30a7408

Browse files
committed
Add tooltip on IPv4Input to mitigate weak feedback
such as: - no keyboard showing up on mobile devices like Safari
1 parent 9170f61 commit 30a7408

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/components/parts/IPv4Input.svelte

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ A convenient addition to allow pasting/editing as whole
1818
let button: HTMLButtonElement;
1919
2020
const selectText = (e: Event) => {
21+
// on mobile Safari (Webkit), keyboard will not show up unlike other "normal" browsers - https://github.com/jquery-archive/jquery-mobile/issues/3016
2122
const elm = e.target as HTMLInputElement;
2223
elm.select();
2324
};
@@ -68,16 +69,21 @@ A convenient addition to allow pasting/editing as whole
6869
class="absolute font-mono text-xl lt-sm:text-2xl lt-xs:text-lg text-gray-600 left-11 top-1 lt-sm:top-3 lt-xs:top-4 lt-sm:left-9 lt-xs:left-6 z-30 w-[88%]"
6970
class:hidden={!show}
7071
>
71-
<input
72-
class="invalid:bg-yellow-100 w-full px-1 text-center rounded border border-gray sm:tracking-widest"
73-
type="text"
74-
bind:this={input}
75-
bind:value={inputAsWhole}
76-
{placeholder}
77-
{pattern}
78-
on:focus={selectText}
79-
on:change={evaluate}
80-
on:blur={onInputBlur}
81-
/>
72+
<div
73+
class="tooltip before:text-xs before:mb-1 after:mb-1 tooltip-open mb-20 tooltip-accent w-full"
74+
data-tip={'select/copy/paste/edit'}
75+
>
76+
<input
77+
class="invalid:bg-yellow-100 w-full px-1 text-center rounded border border-gray sm:tracking-widest"
78+
type="text"
79+
bind:this={input}
80+
bind:value={inputAsWhole}
81+
{placeholder}
82+
{pattern}
83+
on:focus={selectText}
84+
on:change={evaluate}
85+
on:blur={onInputBlur}
86+
/>
87+
</div>
8288
</div>
8389
</div>

0 commit comments

Comments
 (0)