jump.js
jump.js copied to clipboard
Error in case of jumping to non-existing target
Hi
Thanks for the great lib!
Following code:
jump(`#SOME-NOT-EXISTING-ID-ON-PAGE`)
will result in quite obscure error:
Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null
I think error can be improved and if there is no target, it should state that no valid target has been received.
Another thing — is it per design that jump.js errors if query doesn't much any element? Though, it is workaraundable, just want to ensure that it isn't a bug.
Thanks!
Has anyone else also noticed what jump(undefined!)
does? It seems to me like it jumps to the bottom of the page?