Problem/Motivation
Input fields width inside a table can break on mobile making the input value unreadable.

Steps to reproduce
- Fresh drupal installation
- Configure claro as site admin theme
- Go to form display settings of basic page content type
/admin/structure/types/manage/page/form-display - Set browser screen width to 411px or use a mobile device
Proposed resolution
Add a breakpoint to handle the form-element width differently on mobile.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | after_patch_iphone5.png | 50.73 KB | marcusvsouza |
| #10 | after_patch_411px.png | 61.09 KB | marcusvsouza |
| #8 | After-patch.png | 29.66 KB | mitthukumawat |
| #4 | Form element width (Responsive).png | 73.02 KB | mitthukumawat |
| #4 | Form element in Galaxy S5.png | 66.82 KB | mitthukumawat |
Issue fork drupal-3205412
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 #3
mhawwari commentedAdding a breakpoint to change the width to "inherit" fixes the problem for me.

Comment #4
mitthukumawat commentedIn Mobile responsive the table is showing fine to me. But when I switched to Galaxy S5 and Iphone 5/SE, the width of form elements inside the table is becoming narrower. I have added the changes from merge request https://git.drupalcode.org/project/drupal/-/merge_requests/461 but still I can see the width showing narrower in mobile devices.
Comment #5
mhawwari commented@mitthukumawat My changes were only added to the claro theme, which from your screenshots doesn't look like you're using it.
Comment #7
mitthukumawat commented@mhawwari Thanks for correcting me, I have checked in claro theme and this issue is fixed now. Adding screenshot for reference. RTB+1
Comment #8
mitthukumawat commentedScreenshot after patch.
Comment #9
lauriiiThis is nice improvement! I posted one question on the MR. It would be great if we could land #3205412: Form element in tables is not readable on mobile before this, but I don't think that's necessarily a hard blocker for this.
Comment #10
marcusvsouza commentedThe patch solves the problem in mobile, I attached two different sizes of mobile devices.
Comment #11
bnjmnmThis is a duplicate of #3135457: Select widths not taken into account when table is rendered, that issue uses
width: autoinstead ofwidth: inheritbut otherwise the same solution. Keeping that one because the issue summary is a little more detailed and it was created ~10 months before this one.