Problem/Motivation
When an International Phone field is added to a content, and the full list of country codes are displayed in the "Form display" configuration form, that list is displayed on the same line (no wrapping).
That list should be wrapped when reaching the table right side. The consequence is that a horizontal scrollbar appears, and the configuration Edit button is pushed waaaay to the right.
A simple fix is to add this CSS:
.field-plugin-summary {
overflow-wrap: break-word;
}
Steps to reproduce
- Install and activate the International Phone module;
- Add an "International phone" field to a content;
- Go to the "Form display" tab and select some country and exclude others;

You should see a (very) long list of excluded countries displayed in the same line, making a horizontal scrollbar appear.

Proposed resolution
Make the list wrap by adding the CSS: overflow-wrap: break-word;.

Remaining tasks
No remaining tasks. Only CSS fix is needed.
User interface changes
No UI changes.
API changes
NO API changes.
Data model changes
No Data model changes.
Release notes snippet
Fix the overflow wrapping of long text in the Field
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screenshot from 2024-01-31 11-10-23.png | 55.77 KB | rupeshghar |
| #9 | Before-claro-patch.png | 268.32 KB | Shubham Sharma 77 |
| #9 | After-claro-patch.png | 286.79 KB | Shubham Sharma 77 |
| #9 | olivero-issue.png | 329.77 KB | Shubham Sharma 77 |
| #9 | stark-issue.png | 265.26 KB | Shubham Sharma 77 |
Issue fork drupal-3331350
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Issue fork phone_international-3331350
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
knibalsComment #3
gauravvvv commentedI can confirm this is happening. I have attached a patch for same, Please review.
Comment #4
sonam.chaturvedi commentedVerified and tested patch #3 on 10.1.x-dev. Patch applied successfully.
Test Steps:
1. Install and activate the International Phone module;
2. Add an "International phone" field to a content;
3. Go to the "Form display" tab and select some country and exclude others;
4. You should see a (very) long list of excluded countries displayed in the same line, making a horizontal scrollbar appear.
5. Apply patch #3
6. Clear drupal cache
7. Repeat step 3
8. Verify list of excluded countries are wrapped and CSS overflow-wrap: break-word; is added
Test Result: List is not wrapped and patch does not resolves the issue
Before Patch:

After Patch:

Comment #5
sonam.chaturvedi commentedComment #6
gauravvvv commentedAttached interdiff, Please check.
Comment #7
gauravvvv commentedComment #8
nayana_mvr commentedVerified the patch #6 and tested it on Drupal version 10.1.x. The patch works fine and I have added the before and after screenshots for reference.
Before patch

After patch

Comment #9
Shubham Sharma 77 commentedApplied patch #6 applied successfully in drupal-10.1.x-dev on the Claro theme.
This is not happening only on a particular theme. The issue is the same in all themes
For ref sharing screenshots...
Comment #10
Shubham Sharma 77 commentedComment #12
rupeshghar commentedComment #13
rupeshghar commentedphone_international module is not supported with 11.x version. phone_international module needs update.
Comment #16
shweta__sharma commentedI have pushed the code kindly review it also @rupeshghar The module is compatible with Drupal 11.x
Thanks
Comment #17
smustgrave commentedSo may need a rebase but I've re-ran the nightwatch tests 3 times and they fail each time.
Comment #19
ahsannazir commentedFIxed the Pipeline. Please review
Comment #20
smustgrave commentedEven though this seems triggered by a contrib module that solution seems simple enough
Comment #21
nod_This area is supposed to be a summary, in this case a list of 10+ countries is not a summary it's the whole thing. Here specifically I would only print the number of excluded countries if it's more than, let's say 5.
Breaking on words could have unintended side effects on narrow screens in regular use cases.
Additionally word-break: break-word; is deprecated https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#break-word
This issue should be moved to the relevant contrib module.
Comment #22
nod_Comment #23
nod_Comment #26
saidatom