James Edwards on Nostr: In Safari, focusing an element destroys the current selection range. That's bad ...
In Safari, focusing an element destroys the current selection range.
That's bad enough, but get this -- the reset has *already happened* when the `focus` event fires, so we can't snapshot the data because it's already lost. And yet the resulting `selectionchange` event **hasn't** fired yet, so we can't use that event to filter-out the change.
Are you fucking kidding me??
#javascript #selection #caret
Published at
2024-06-16 13:36:48Event JSON
{
"id": "3a0092d3bf2ecef2aa5f2c6d5b4a79b5976d8f5525a7abe756c8a646713435b2",
"pubkey": "5d78a900466c87ad276db31284220f3ac3611f9d40d4e0f9adabe87673b35e0a",
"created_at": 1718545008,
"kind": 1,
"tags": [
[
"t",
"javascript"
],
[
"t",
"selection"
],
[
"t",
"caret"
],
[
"proxy",
"https://mastodon.world/users/siblingpastry/statuses/112626565665663334",
"activitypub"
]
],
"content": "In Safari, focusing an element destroys the current selection range.\n\nThat's bad enough, but get this -- the reset has *already happened* when the `focus` event fires, so we can't snapshot the data because it's already lost. And yet the resulting `selectionchange` event **hasn't** fired yet, so we can't use that event to filter-out the change.\n\nAre you fucking kidding me??\n\n#javascript #selection #caret",
"sig": "840027fe382ec0deab0b57e6df87ed21ac5a66b87310540d87b0850c3d20b31a40b16048bf50c9b02817325b4991a53dea07fcb66b93a5932663a968d75fc3e3"
}