Fix onChange event not firing on Safari when onInput is registered#1264
Fix onChange event not firing on Safari when onInput is registered#1264
Conversation
Co-authored-by: iOvergaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: iOvergaard <752371+iOvergaard@users.noreply.github.com>
|
|
@copilot did you verify the bug before trying to fix it with this 'hack'? |
You're right to question this. I implemented the fix based on the issue description without independently verifying the Safari bug exists in current versions. After researching:
The real question: Is this a legacy Safari bug that's fixed in modern versions, or does it still exist? I've created Recommendation:
Should I revert the changes pending real Safari verification? |
|
@mattbrailsford it would seem this issue is hard to reproduce in newer versions of Safari. Do you have any insights into which version you were testing this claim, please?
|



Description
Safari doesn't fire native
changeevents reliably wheninputevents are also handled. This breaks workflows relying ononChangefor triggering actions after user input completes.Implementation:
_valueOnFocus)changeevent if value changed_changeEventFiredSinceFocusflag to prevent duplicate events when nativechangefires (Chrome, Firefox)Code example:
Types of changes
Motivation and context
Related to umbraco/Umbraco.Commerce.Issues#713
Safari-specific browser quirk where
changeevents fail to fire wheninputhandlers are present. Impacts form validation and dependent field updates in Umbraco Commerce and other consumers.How to test?
uui-inputwith both@inputand@changelistenerschangeevent fires on blurAutomated tests: 4 new tests validate Safari workaround and prevent duplicate events in standard browsers. All 50 tests pass on Chromium, Firefox, Webkit.
Screenshots (if appropriate)
N/A - behavioral fix, no visual changes
Checklist
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
onChangeevent doesn't fire whenonInputis also registered on Mac + Safari #1146💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.