TypeError: Cannot read property 'createRange' of undefined
See original GitHub issueHello,
I got this error when using ngx-currency with material input.
<input matInput type="number" placeholder="0" formControlName="buildingValue" required currencyMask >
TypeError: Cannot read property 'createRange' of undefined
at InputManager.get [as inputSelection] (input.manager.js:46)
at InputManager.get [as canInputMoreNumbers] (input.manager.js:27)
at InputService.get [as canInputMoreNumbers] (input.service.js:137)
at InputHandler.push../node_modules/ngx-currency/src/input.handler.js.InputHandler.handleKeypress (input.handler.js:82)
at CurrencyMaskDirective.push../node_modules/ngx-currency/src/currency-mask.directive.js.CurrencyMaskDirective.handleKeypress (currency-mask.directive.js:76)
Angular CLI: 7.3.9
Node: 10.16.0
OS: win32 x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
Unable to get property 'createRange' of undefined or null ...
When an object is null you cannot query it, because the structure containing the information you need does not exist. Share.
Read more >Cannot read property 'createRange' of undefined #30 - GitHub
Uncaught TypeError: Cannot read property 'createRange' of undefined at t.default (get-input-selection.js:1) at t.value (bundle.js:1) at ...
Read more >Unable to get property 'createRange' of undefined or null ...
I'm going to propose a hack, that may or may not work since I have no way to test it myself. As you...
Read more >Unable to get property 'createrange' of ... - CodeProject
Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it...
Read more >JavaScript runtime error: Unable to get property createRange ...
But i am getting error : 0x800a138f - JavaScript runtime error: Unable to get property 'createRange' of undefined or null reference.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Cerbrus the issue is with
type="number". If you remove this then it works nicely. The error message should be different though, because it took me a while to find the cause.Well that helps! It works like a charm now.
This should probably be documented somewhere.