Skip to content

Remove redundant listener#2654

Merged
Crabcyborg merged 1 commit into
masterfrom
remove_redundant_listener
Dec 12, 2025
Merged

Remove redundant listener#2654
Crabcyborg merged 1 commit into
masterfrom
remove_redundant_listener

Conversation

@Crabcyborg

Copy link
Copy Markdown
Contributor

This should be covered by the code immediately above.

[ 'focus', 'blur', 'change' ].forEach( function( eventName ) {
	documentOn(
		eventName,
		selector,
		function( event ) {
			checkFloatLabel( event.target );
		},
		true
	);
} );

@Crabcyborg Crabcyborg self-assigned this Dec 12, 2025
@Crabcyborg Crabcyborg added this to the 6.27 milestone Dec 12, 2025
@coderabbitai

coderabbitai Bot commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

A delegated jQuery change event handler was removed from the form library to eliminate duplicate float label handling. The code now exclusively uses an alternative event delegation path (documentOn) to trigger checkFloatLabel updates, reducing redundant invocations.

Changes

Cohort / File(s) Change Summary
Event Handler Removal
js/formidable.js
Removed delegated jQuery on('change', ...) handler that called checkFloatLabel, consolidating float label updates to use the existing documentOn delegation path for change events.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modification focused on event handler cleanup
  • Verify that removing the delegated handler does not cause float label state misses
  • Confirm documentOn delegation provides equivalent coverage for change event handling

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Remove redundant listener' accurately describes the main change: removing a redundant event listener from the code.
Description check ✅ Passed The description is related to the changeset, providing context about which redundant listener was removed and showing the code that now handles it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove_redundant_listener

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf1c4a1 and 4c23957.

📒 Files selected for processing (1)
  • js/formidable.js (0 hunks)
💤 Files with no reviewable changes (1)
  • js/formidable.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: Cypress
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: Cypress

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Crabcyborg
Crabcyborg merged commit 512429a into master Dec 12, 2025
34 of 36 checks passed
@Crabcyborg
Crabcyborg deleted the remove_redundant_listener branch December 12, 2025 20:59
@Crabcyborg Crabcyborg modified the milestones: 6.27, 6.26.1 Dec 15, 2025
stephywells pushed a commit that referenced this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant