VEuPathDB / EbrcWebsiteCommon

Apache License 2.0
3 stars 3 forks source link

ExternalContentController: fix potential infinite loop when scrolling to the "hash" #146

Closed jtlong3rd closed 2 years ago

jtlong3rd commented 2 years ago

How to reproduce the bug:

  1. Check out this PR's branch
  2. On the genomics local dev environment, navigate to https://localhost:3000/a/app/workspace/datasets/help#sample
  3. You'll see an infinite loop of static content network calls (closer inspection reveals that the ExternalContentController is being repeatedly mounted and unmounted)

This PR resolves the infinite loop by changing the way we scroll to the hash specified by the ExternalContentController's url - now, the scrolling is handled by our scrollIntoView DOM utility, instead of location.assign.

(To test, yarn link / npm-pack-here / relative-deps this PR's branch to the ApiCommonWebsite branch indicated above. Repeating the steps above should not trigger the infinite loop.)