Ok, browsers are ignoring pattern, lets use type=number
This commit is contained in:
parent
7d812709a4
commit
9f72e5393b
1 changed files with 15 additions and 1 deletions
|
@ -12,7 +12,21 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* Chrome, Safari, Edge, Opera */
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Firefox */
|
||||
input[type=number] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<p>Úlohu zatím nemáš vyřešenou, opravdu si chceš vyzradit řešení?</p>
|
||||
{a} + {b} = <input type=text pattern="[0-9]*" on:input={e => newValue(+e.currentTarget.value)}>
|
||||
{a} + {b} = <input type="number" on:input={e => newValue(+e.currentTarget.value)}>
|
||||
</div>
|
||||
|
|
Reference in a new issue