Skip to content

Fixes for inconsistent state loading#686

Merged
EdwardMoyse merged 2 commits intomainfrom
main-investigate-state-loading
Sep 20, 2024
Merged

Fixes for inconsistent state loading#686
EdwardMoyse merged 2 commits intomainfrom
main-investigate-state-loading

Conversation

@EdwardMoyse
Copy link
Collaborator

Now, let me clearly state that I do not precisely know what is going on here!

However, as discussed in various tickets (specifically #582, but possibly also others), loading files has been very unreliable. In #603 I tried to add a wait, which seemed to help, but which recently (new Safari version?) became less effective.

After a lot of googling, it seems like this is a known issue in Safari - the onchange event never gets called/sent, with the consequence that the file is never loaded.

The changes to inputFile.onclick and invalid are supposed to be failsafes. I think they probably aren't actually needed, but I have left them in case.

What I think might have been happening is that inputfile was either being deleted before the callback could happen (which is why the wait added in #603 helped). And I also noticed that inputfile sometimes seemed to hang around.

So I thought adding it to the document might help with these kinds of issues - so I believe this is the real fix:

 const inputFile = document.createElement('input');
  document.body.appendChild(inputFile);

This PR also contains a fix for a deprecation in TextGeometry in recent threejs versions.

@EdwardMoyse EdwardMoyse merged commit 407445a into main Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant