@nebularstreams/libmui 2.5.109 → 2.5.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -196,6 +196,12 @@ const
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
|
+
onbeforeinput: (e) => {
|
|
200
|
+
if (attrs.subtype === "number" && e.data && !/^[0-9.]$/.test(e.data)) {
|
|
201
|
+
e.preventDefault(); // nothing but 0-9 or “.” gets through
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
inputmode: attrs.subtype === "number" ? "decimal" : undefined, // nicer mobile keyboard
|
|
199
205
|
onkeypress: (event) => {
|
|
200
206
|
if (!state.showInput && event.key === "Enter") {
|
|
201
207
|
attrs.onenter && attrs.onenter(event.target.value, event);
|