mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
apply spinbox limits on each keystroke
This commit is contained in:
parent
4e63de0625
commit
460ff354da
1 changed files with 5 additions and 7 deletions
|
@ -13,15 +13,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
export let warnings: string[] = [];
|
export let warnings: string[] = [];
|
||||||
export let defaultValue: number = 0;
|
export let defaultValue: number = 0;
|
||||||
|
|
||||||
function blur() {
|
$: if (value > max) {
|
||||||
if (value > max) {
|
value = max;
|
||||||
value = max;
|
} else if (value < min) {
|
||||||
} else if (value < min) {
|
value = min;
|
||||||
value = min;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ConfigEntry {label} {subLabel} {warnings} bind:value {defaultValue}>
|
<ConfigEntry {label} {subLabel} {warnings} bind:value {defaultValue}>
|
||||||
<input type="number" {min} {max} bind:value on:blur={blur} class="form-control" />
|
<input type="number" {min} {max} bind:value class="form-control" />
|
||||||
</ConfigEntry>
|
</ConfigEntry>
|
||||||
|
|
Loading…
Reference in a new issue