Fix project renaming in safari #450

Merged
Irev-Dev merged 1 commits from kurt/434-rename-projects-safari into main 2021-08-11 21:12:50 +02:00
Irev-Dev commented 2021-08-11 12:48:54 +02:00 (Migrated from github.com)

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.

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 2021-08-11 12:49:53 +02:00 (Migrated from github.com)

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.

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.
franknoirot (Migrated from github.com) approved these changes 2021-08-11 15:14:35 +02:00
franknoirot (Migrated from github.com) left a comment

Nice find 🔎

Nice find 🔎
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#450