@ramblurr instead of walking the tree manually there is https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#:~:text=The%20closest()%20method%20traverses,element%20exists%2C%20it%20returns%20null%20.
Oh brilliant, thanks @alpox. The dom apis are pretty huge these days, my memory of them is still stuck in 2007
@ramblurr Sounds to me that React Ref https://reactjs.org/docs/refs-and-the-dom.html is the tool for the job
thanks @rap1ds refs are exactly what this needed.
works as advertised