📚 - Update documentation about supported types of `<input />`
Semanual opened this issue · 3 comments
Which package(s) are the source of the bug?
@maskito/core
Playground Link
https://stackblitz.com/edit/5cd2ez?file=index.ts
Description
Steps to reproduce:
Just write any number at the input box
I understand that in #1121 you said it is impossible to support <input type="number"/>
, and okay, I get it, it is not supported, we shouldn't use it in first place. But this error message (An attempt was made to use an object that is not, or is no longer, usable
) does not help at all, and things actually go wrong inside the code, without any hint that type="number"
is the root problem. Could you please update this to an error message like, Type "number" in inputs is not supported, please use type "text" instead
? (I am not sure if this should be a feature request, but it is caused by a bug, so I'm filling a bug report)
Maskito version
2.2.0
Which browsers have you used?
- Chrome
- Firefox
- Safari
- Edge
Which operating systems have you used?
- macOS
- Windows
- Linux
- iOS
- Android
These errors come from native JS issues with input type="number". I'm not sure we want any extra bytes in the library bundle to address unsupported usage. The goal of core library is to be as light weight as possible and input type="number" is very restrictive in its nature by the browser, you cannot technically do anything with it. @nsbarsukov maybe we should put some sort of a banner in the docs warning people?
Line 29 in ef772cb
- - You can use it with `HTMLInputElement` or `HTMLTextAreaElement` or even with `[contenteditable]` element.
+ - You can use it with `<input type="text" />` or `<textarea />` or even with `[contenteditable]` element.
Probably a good idea to explicitly state it does not work with other types and maybe even state a reason or link to your investigation.