fix: default pointer event pointerType to empty string instead of the string "undefined" - #1325
Conversation
String(undefined) produced an invalid pointerType token. Pointer events without an explicit type should leave the property unset. Change-Id: Ib2f744ee8eb282499c83e5f483d9301d4b3d5e99 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the PR. I don't think this is quite right, you're editing the initialisation of the PointerEvent, but the spec says that it should be initialised to an empty string https://w3c.github.io/pointerevents/#pointerevent-interface so it shouldn't ever be undefined. I checked this on Chrome as well, https://jsfiddle.net/f6nLaruj/ by focusing the button, then pressing "Enter". This results in It'd be good to test the same user flow instead of directly asserting on createEvent, that's not a very helpful test as it's not something we can compare the results of against browsers. It's useful to stop a regression, but for proof for this PR, it's not accurate. |
Change-Id: I1754ed6e71ea154f86d8e4ea75c5729f32c63b62 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Updated in
|
Co-authored-by: Rob Snow <snowystinger@gmail.com>
reduce whitespace changes Co-authored-by: Rob Snow <snowystinger@gmail.com>
|
馃帀 This PR is included in version 14.6.6 馃帀 The release is available on: Your semantic-release bot 馃摝馃殌 |
What
Set
pointerTypeto an empty string on synthetic click events when no pointer type was provided, instead of setting it to the string"undefined".Why
initPointerEventusedString(pointerType). WhenpointerTypeis missing, that becomes the invalid token"undefined". Real click events can have an unsetpointerType; they should never use that string.Fixes #1291
How
Set
pointerTypeto an empty string when it is defined.Testing
Checklist
Made with Cursor