pull down to refresh
15 sats \ 0 replies \ @k00b 10 Mar 2022 \ parent \ on: Daily discussion thread
It was a race condition. I render the twitter embed in a container of fixed size so there isn't layout shift. I then use an "onload" callback to determine when the iframe loads to detect if there's overflow. If there's overflow, I display the button to expand the container. It appears that the onload callback was being triggered before the content loaded in a way that would allow me to measure its height. The fix was just to assume that the container always has overflow (which it will) and always display the button following onload.