Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for inconsistent state loading #686

Merged
merged 2 commits into from
Sep 20, 2024

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
1 check passed
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