Fix for SubmitEvent polyfill breaking requestSubmit() for newer Safari versions #933
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses an issue where the current polyfill for SubmitEvent is not functioning as expected on the newer versions of Safari. It appears that the original webkit issue the polyfill was meant to address has been resolved, and the polyfill is now introducing undesired behavior.
Specifically, this issue is observed when invoking the requestSubmit() method with a submitter as an argument in Safari 16.5. According to the current behavior, the submitter argument seems to be ignored (ref https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit).
In an attempt to correct this, I've made adjustments to the polyfill logic and added a browser test to confirm the fix. The test fails when executed in the webkit environment with the old polyfill but passes successfully with the revised version in this PR. The command used to run the test is as follows:
Please note that for this test to work, I had to add the webkit browser to the playwright.config.ts. I've omitted those changes in this PR to keep it focused on the issue at hand.