Conversation
Trac: Modernize unsaved changes warning on ticket forms. - Fix false warnings when submitting comments or tickets via keyboard shortcuts. - Fix unsaved warning protection being permanently lost if form submission is cancelled or prevented. - Use standard `window.addEventListener( 'beforeunload', ... )` instead of assigning directly to `window.onbeforeunload`. - Use `event.preventDefault()` and set `event.returnValue = ''`, as modern browsers no longer display custom dialog strings. - Track form submissions with an `isSubmitting` flag on `#propertyform` submit, resetting the flag if submission is prevented.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe ticket form warning compares trimmed summary and description values with their initial values. On existing tickets, a nonblank trimmed comment also counts as unsaved content. Submission suppresses the warning unless the browser prevents submission. ChangesTicket Form Unload Warning
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No concrete merge-blocking behavior is established; the change appears mergeable with normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Trac: Modernize unsaved changes warning on ticket forms.
isDirty()check againstdefaultValueto prevent false warnings on pre-filled follow-up tickets.window.addEventListener( 'beforeunload', ... )instead of assigning directly towindow.onbeforeunload.event.preventDefault()as modern browsers no longer display custom dialog strings.isSubmittingflag on#propertyformsubmit, resetting the flag if submission is prevented.Summary by CodeRabbit
Summary