Skip to content

Block Editor: Forward UnitControl props in TextIndentControl with the slider - #86832

Merged
manzoorwanijk merged 2 commits into
WordPress:trunkfrom
saranshsinhaa:fix/text-indent-control-slider-props
Nov 17, 2026
Merged

manzoorwanijk merged 2 commits into
WordPress:trunkfrom
saranshsinhaa:fix/text-indent-control-slider-props

Conversation

@saranshsinhaa

Copy link
Copy Markdown
Contributor

What?

Follow-up to #84848 (comment). Tracks #67691.

TextIndentControl now forwards its extra UnitControl props when withSlider is set, as it already does without the slider.

Why?

Without the slider, the extra props (otherProps) are spread onto the UnitControl. With withSlider, a different UnitControl is rendered and they're dropped, even though the type accepts them.

How?

Spread otherProps onto the slider's UnitControl, before the component's own props, matching the non-slider branch. Adds a test that a forwarded prop (disabled) reaches the input in both modes. The slider case fails without the fix.

Testing Instructions

  1. npm run test:unit -- packages/block-editor/src/components/text-indent-control

Use of AI Tools

Used Claude Code with Opus 5.5 to draft the code and PR, and verified the fix with the unit test and in the browser.

@coderabbitai review as per the rules given in #67691

@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: saranshsinhaa <saranshsinha@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

@saranshsinhaa
saranshsinhaa marked this pull request as ready for review November 16, 2026 12:43
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • The “Line indent” control now correctly reflects its disabled state when displayed with a slider, matching its behavior without a slider. This prevents users from changing the indent through the slider-enabled control when it is disabled.

The slider-enabled UnitControl now receives otherProps. A parameterized test checks that the “Line indent” spinbutton is disabled with and without the slider.

Changes: Text indent control

Layer / File(s) Summary
Forward control props
packages/block-editor/src/components/text-indent-control/index.tsx, packages/block-editor/src/components/text-indent-control/test/index.jsdom.test.tsx
The slider-enabled UnitControl now receives otherProps. The test checks that the “Line indent” spinbutton is disabled for both withSlider values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to bf9d6

This forwards extra control props, such as disabled, to the text indent input when the slider is enabled, matching the behavior without the slider. The change is small and tested, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: TextIndentControl now forwards UnitControl props when the slider is enabled. The raw summary confirms the slider-enabled UnitControl receives otherProps, so the title …
Description check Passed The description states that TextIndentControl now forwards extra UnitControl props when withSlider is set. It explains the cause, the fix (spreading otherProps before the component's own props), and a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: TextIndentControl now forwards UnitControl props when the slider is enabled. The raw summary confirms the slider-enabled UnitControl receives otherProps, so the title matches the changeset.

Full details: Description check

Explanation

The description states that TextIndentControl now forwards extra UnitControl props when withSlider is set. It explains the cause, the fix (spreading otherProps before the component's own props), and adds a test for a forwarded disabled prop. This matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0b29aa8 and bf9d607.

Files selected for processing: 2

  • packages/block-editor/src/components/text-indent-control/index.tsx
  • packages/block-editor/src/components/text-indent-control/test/index.jsdom.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@manzoorwanijk manzoorwanijk added the [Type] Code Quality Issues or PRs that relate to code quality label Nov 17, 2026
@manzoorwanijk manzoorwanijk added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Nov 17, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Nov 17, 2026
@manzoorwanijk
manzoorwanijk merged commit 8bb4f44 into WordPress:trunk Nov 17, 2026
110 of 112 checks passed
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants