jump.js icon indicating copy to clipboard operation
jump.js copied to clipboard

Error in case of jumping to non-existing target

Open ArmorDarks opened this issue 7 years ago • 1 comments

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!

ArmorDarks avatar Aug 18 '17 17:08 ArmorDarks

Has anyone else also noticed what jump(undefined!) does? It seems to me like it jumps to the bottom of the page?

xrzhuang avatar Mar 02 '20 22:03 xrzhuang