robinparisi/tingle

onOpen does not wait for window to open in Safari for iOS

dvdmon opened this issue · 0 comments

I've run into an issue that only crops up on Safari for the iPhone. I'm calling a predefined page of content as the content of my window - its's a formatted page with ids embedded in a hidden input. The onOpen option then has a statement that populates a variable with the ids from that's needed in another part of the script. The problem is that while the modal is loaded before these statements for most browsers, for safari on iOS for some reason the statements run before the modal actually renders and so the hidden fields are not available and an error happens. I tried using a JS timeout around these statements (within the onOpen option), but no matter how long I make it, it seems that onOpen halts the execution of the rendering of the modal.