Make WordPress Core

Opened 2 years ago

Last modified 8 days ago

#59746 new defect (bug)

Adding User Biographical Info without space breaks the container and adds horizontal scroll

Reported by: mihirdev21's profile mihirdev21 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3.2
Component: Users Keywords: reporter-feedback needs-test-info needs-screenshots
Focuses: ui Cc:

Description

I found one issue in User Biographical Info module.
Whenever I am adding bio without spacing, it breaks the container and adds horizontal scroll !

Attachments (4)

T21-author-bio-word-overflow.png (25.5 KB) - added by sabernhardt 6 months ago.
extra-long word in the author biography paragraph with Twenty Twenty-One, causing horizontal scroll
before-fix.png (82.9 KB) - added by zluck 5 months ago.
before fix
after-fix.png (85.5 KB) - added by zluck 5 months ago.
after fix
59746.diff (967 bytes) - added by zluck 5 months ago.
patch file

Download all attachments as: .zip

Change History (11)

#1 @mihirdev21
2 years ago

Hello guys just to let you know...this issue is also reproduceable in WordPress 6.4 - beta2

#2 @Presskopp
6 months ago

easy fix:

.wp-block-post-author-biography {
    word-wrap: break-word;
}

@sabernhardt
6 months ago

extra-long word in the author biography paragraph with Twenty Twenty-One, causing horizontal scroll

#3 @sabernhardt
6 months ago

  • Keywords reporter-feedback added

Does this relate to the author biography paragraph on the front end? The ticket mentions Twenty Twenty-One, and the screen recordings are not available anymore. If the theme needs to break words, the bio styles could include either word-wrap or overflow-wrap (the theme uses overflow-wrap for .entry-title and word-wrap for other content).

If the Post Author Biography block should break words for block themes, that would belong on the Gutenberg repository (Post Author Biography issues and block stylesheet).

#4 @iamadisingh
6 months ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 138.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Additional Notes

  • I have added this dummy text into users Biographical Info: Thisisaverylongstringofwordswithoutanyspacesorbreaksitjustkeepsgoingandgoingandwillcausehorizontalscrollingissuesbecausetherearenowordbreak.

Supplemental Artifacts

Screen recording: https://files.catbox.moe/sg4gd6.mov

#5 @iamadisingh
6 months ago

It looks like this issue is specific to the Post Author Biography block, which is part of the Gutenberg and this issue should be opened there also.

@zluck
5 months ago

before fix

@zluck
5 months ago

after fix

#6 @zluck
5 months ago

  • Keywords has-patch needs-testing added; needs-patch reporter-feedback removed

This patch adds a targeted CSS rule for .wp-block-post-author-biography in Twenty Twenty-Five to prevent overflow when the author bio contains a long unbroken string.

Changes

  • Added assets/css/author-bio-wrap.css with overflow-wrap: anywhere and word-break: break-word rules.
  • Enqueued it specifically for the core/post-author-biography block using wp_enqueue_block_style in functions.php, with both src and path for performance inlining.

Testing

  • Reproduced on a fresh WP 6.8.1 and trunk install with Twenty Twenty-Five active.
  • Steps: Add a long (300+ char) string without spaces in the Biographical Info field, view on a single post with Post Author Biography block.
  • Before: Biography text overflows horizontally, breaking layout.
  • After: Text wraps inside the container, no horizontal scroll.

Tested in Chrome 138, Firefox 128, and Edge 127 on Windows 11, plus Chrome 138 on macOS 14.

Attachments

  • Before and after screenshots.
  • Patch file 59746.diff.

Ready for testing and feedback.

@zluck
5 months ago

patch file

#7 @huzaifaalmesbah
8 days ago

  • Keywords reporter-feedback needs-test-info needs-screenshots added; has-patch needs-testing removed

Thanks for the investigation and patch, @zluck. your patch 59746.diff

I’d like to clarify a few points based on the original report and current status:

  • The issue was originally reported and reproduced on Theme: Twenty Twenty-One, while most recent testing and the proposed fix target Twenty Twenty-Five. This makes it unclear whether the root problem is theme-specific or block-level, and whether Twenty Twenty-One is still affected or addressed.
  • The patch references assets/css/author-bio-wrap.css, but this file doesn’t exist in the older core codebase, so it’s not clear how or where it’s being added.
  • Because of this, the patch doesn’t seem ready for proper testing yet.

I think reporter-feedback is still needed. and removing the has-patch and needs-testing keywords based on the current state of ticket.

Note: See TracTickets for help on using tickets.