Irev-Dev / cadhub

We're out to raise awareness and put CodeCAD on the map. The success of CadHub can be measured by the amount it promotes the use of CodeCAD within the mechanical/manufacturing industry and the strength the CadHub community.
https://cadhub.xyz
GNU General Public License v3.0
319 stars 60 forks source link

Fix project renaming in safari #450

Closed Irev-Dev closed 3 years ago

Irev-Dev commented 3 years ago

Resolves #434

basically the flow i was going for was that if you loose focus the name is reverted.

https://user-images.githubusercontent.com/29681384/129016133-98391d12-331d-4a83-ad82-5753831202a4.mov

but because clicking the rename button is also loosing focus but onblur is called before the button's on click handler i was using the relatedTarget event property to tell if it was just loosing focus or loosing focus because the button was pressed, but safari doesn't seem to support that property so using a good old time out instead to allow the button handle a chance to fire, and since it redirects the user anyway the fact that setNewTitle etc is still called is not a problem.

Irev-Dev commented 3 years ago

hmmm maybe a less hacky option would be to turn this into a mini form with the button being the form submisson . . not sure and couldn't be bothered tbh.