Skip to content

fix: remove extra padding-right on number inputs and fix flex group overflow (GH#829)#832

Merged
superdav42 merged 1 commit intomainfrom
feature/auto-20260413-201634
Apr 14, 2026
Merged

fix: remove extra padding-right on number inputs and fix flex group overflow (GH#829)#832
superdav42 merged 1 commit intomainfrom
feature/auto-20260413-201634

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

Fixes the visual bug where the duration unit select (Day(s)/Month(s)/etc.) is hidden by the browser-native spinner arrows (up/down buttons) on the number input in the product edit page pricing configuration.

Root Cause

Two compounding issues:

  1. Padding: WP admin's forms.css applies padding: 0 12px to all text-type inputs including input[type=number]. The browser renders spinner arrows inside this right 12 px padding area, making the spinner appear to crowd or obscure adjacent elements in tight flex-group layouts.

  2. Layout overflow: In the amount_group and price_variations group fields, the duration number input wrapper used wu-mx-2 (8 px margins on both sides). This added 16 px of extra margin to a 1/3 + 2/3 = 100% flex layout, causing the container to overflow and flex-shrink to squeeze the duration_unit select to near-zero width — directly behind the spinner.

Changes

assets/css/admin.css

Added .wu-styling input[type="number"] { padding-right: 0; } scoped to the admin area to remove the extra right padding. The spinner sits flush at the right border without stealing horizontal space from neighbouring elements.

inc/admin-pages/class-product-edit-admin-page.php

  • amount_group > duration: wu-mx-2 wu-w-1/3wu-ml-2 wu-w-1/3 (left margin only — eliminates 8 px right-side overflow, preserves visual gap between the money amount field and the duration number)
  • price_variations_duration_unit: wu-w-1/3 wu-mx-2wu-w-1/3 wu-ml-2 (same fix for price variations group)

Testing

Verify in the WP network admin → Products → Edit any recurring product:

  1. The "Price" widget shows [Amount] [Duration number] [Unit select] — the unit select (Months/Years/etc.) should be fully visible and not obscured by the spinner arrows
  2. The "Price Variations" section shows [Duration] [Period select] [New Price] — all three fields should be visible
  3. Inspect input[type="number"] elements in the admin forms — they should have padding-right: 0 applied via .wu-styling input[type="number"]

Resolves #829

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 36 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 36 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac1e5683-3718-4ed3-81e1-6f069f2964c8

📥 Commits

Reviewing files that changed from the base of the PR and between 1350b0f and 15466fa.

📒 Files selected for processing (2)
  • assets/css/admin.css
  • inc/admin-pages/class-product-edit-admin-page.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260413-201634

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.

…verflow (GH#829)

WP admin applies padding: 0 12px to all text-type inputs including
input[type=number]. Browser-native spinner arrows occupy the right side
of the element, and the extra 12px of right padding makes the spinner
visually crowd or obscure adjacent select fields in flex-group layouts
(e.g. duration + duration_unit on the product edit page).

CSS fix: add .wu-styling input[type=number] { padding-right: 0 } to
admin.css so the spinner sits flush at the right border without stealing
horizontal space from neighbouring elements.

Layout fix: in the amount_group and price_variations group fields, the
duration number input wrapper used wu-mx-2 (8 px on both sides). This
added 16 px of margin to a 1/3 + 2/3 = 100% width layout, causing the
flex container to overflow and squeezing the duration_unit select to
near-zero width. Changing wu-mx-2 to wu-ml-2 (left margin only) removes
the right-side overflow while preserving the visual spacing between the
amount field and the duration number input.

Fixes #829
@superdav42 superdav42 force-pushed the feature/auto-20260413-201634 branch from 07c6e86 to 15466fa Compare April 14, 2026 02:37
@superdav42 superdav42 merged commit 747a50d into main Apr 14, 2026
7 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Merge Summary

PR #832 merged into main — resolves GH#829.

What was done

  • CSS (assets/css/admin.css): Added .wu-styling input[type="number"] { padding-right: 0 } to remove the extra 12 px right padding that WP admin's forms.css applies to number inputs. The browser-native spinner arrows occupy the right edge; the extra padding was crowding adjacent flex-group fields.
  • PHP (inc/admin-pages/class-product-edit-admin-page.php): Changed wu-mx-2 to wu-ml-2 on the duration wrapper in amount_group and price_variations_duration_unit. This removes the 8 px right margin that was creating a 16 px overflow in a 1/3 + 2/3 = 100% flex layout, causing the duration unit select to be squished near-zero and visually hidden behind the spinner.

How to verify

  1. Network admin → Products → Edit a recurring product
  2. In the Price widget: [Amount] [Duration] [Unit] — all three fields visible, unit not obscured by spinner
  3. In the Price Variations section: [Duration] [Period] [New Price] — all three fields visible
  4. Inspect input[type="number"] in admin forms: padding-right: 0 applied via .wu-styling input[type="number"]

aidevops.sh v3.8.17 plugin for OpenCode v1.4.3 with claude-sonnet-4-6 spent 21m and 584 tokens on this as a headless worker. Solved in 2m.

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

Performance Test Results

Performance test results for 7eb3fb3 are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 41 37.79 MB 824.00 ms (-46.50 ms / -6% ) 156.00 ms (+5.00 ms / +3% ) 1014.50 ms (-57.50 ms / -6% ) 1980.00 ms 1890.25 ms (-38.85 ms / -2% ) 91.45 ms
1 56 49.02 MB 952.50 ms 145.00 ms 1098.50 ms 2116.00 ms 2034.25 ms 80.55 ms

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.

The duration unit on the product edit page is hidden by the up/down button

1 participant