who-owns-what icon indicating copy to clipboard operation
who-owns-what copied to clipboard

Make a function that abstracts our querySelector logic

Open sraby opened this issue 4 years ago • 1 comments

In our DetailView component we use the document.querySelector() function to scroll to the top of the wrapper div. This usage created some problems when we converted to typescript as we then needed to check for the existence of such a HTML element before calling .scrollTop on it. @toolness suggested that we could actually make a helper function that repeats this logic in a more abstract way so we can use it around our codebase.

sraby avatar Jul 29 '20 15:07 sraby

Roight, there is actually such a helper in @justfixnyc/util actually! https://github.com/JustFixNYC/justfix-ts/blob/master/packages/util/get-html-element.ts

toolness avatar Jul 29 '20 15:07 toolness