Problem/Motivation

While installing drupal 8 on mobile there is a default country select box issue on configuration page.Adding a screenshot of a issue.

Proposed resolution

Change select box width to 100% on Installation screen

Original report by @Vidushimehta

CommentFileSizeAuthor
#60 After_patch.png92.35 KBTrupti Bhosale
#60 Before_Patch.png105.3 KBTrupti Bhosale
#59 select-box-issue-in-configuration-page-on-mobile-2392729-59.patch363 bytesalvimurtaza
#52 select-box.png108.63 KBmaninders
#50 Screen Shot 2016 05 15 at 11.10.18 PM.png277.05 KBmanjit.singh
#46 Screen Shot 2016-05-13 at 11.37.11 AM.png2.13 MBvsawant
#41 Configure site Drupal.png217.71 KBalvimurtaza
#41 select-box-issue-in-configuration-page-on-mobile-2392729-41.patch577 bytesalvimurtaza
#39 2392729-Select_box_issue_in_configuration_page_on_mobile-10811984.patch331 bytesSumit kumar
#37 Screenshot from 2016-01-30 14:09:41.png141.6 KBejb503
#35 selectboxes.png499.86 KBmanjit.singh
#32 before-after-landscape.jpg122.25 KBsimply021
#32 before-after-portrait.jpg189.38 KBsimply021
#32 select-mobile-2392729-32.patch4.1 KBsimply021
#28 2392729-23-select-box-screenshot-w570-02.png60.08 KBvolodymyr.oliinyk
#28 2392729-23-select-box-screenshot-w570-01.png81.17 KBvolodymyr.oliinyk
#28 2392729-23-select-box-screenshot-w360-02.png45.06 KBvolodymyr.oliinyk
#28 2392729-23-select-box-screenshot-w360-01.png70.79 KBvolodymyr.oliinyk
#23 2392729-23-select-box-issue.patch606 bytesmanjit.singh
#20 screenshot-select-box-patch.png251.3 KBstudiozut
#19 2392729-select-box-issue.patch672 bytesstudiozut
#15 different-width-select-fields.png171.23 KBmeeli
#14 rerolled_patch-2392729-14.patch462 bytesvipulaSD
#13 Screenshot_2015-01-05-14-44-07.png109.33 KBdeepakkumar14
#11 Screenshot from 2015-01-05 12:31:30.png97.19 KBdeepakkumar14
#11 Screenshot from 2015-01-05 12:12:58.png372.08 KBdeepakkumar14
#8 select_box_2392729-8.patch371 bytesskippednote
#8 site-configure.png31.63 KBskippednote
#8 node-creation.png15.73 KBskippednote
#5 select_box_issue_on_installing-2392729-1.patch1.14 KBSumit kumar
#1 Select-box-issue-on-configuration-page-in-mobile-2392729.patch392 bytesVidushi Mehta
default country select box.png99.89 KBVidushi Mehta

Comments

Vidushi Mehta’s picture

Applying patch for the default country select box issue.

Vidushi Mehta’s picture

Status: Needs work » Needs review
Sumit kumar’s picture

Status: Needs review » Needs work
Vidushi Mehta’s picture

Title: Select box issue on configuration page in mobile » Select box issue in configuration page on mobile
Sumit kumar’s picture

StatusFileSize
new1.14 KB

Applying patch for the default country select box issue.

Sumit kumar’s picture

Status: Needs work » Needs review
manjit.singh’s picture

Issue summary: View changes
skippednote’s picture

StatusFileSize
new15.73 KB
new31.63 KB
new371 bytes

I tested the patches and they seem to be causing some unintended changes. The #5 patch is effecting all the select elements, also its targeting the select element instead of using a class .form-select. On the node creation page the select element for Text Format is getting stretched to 100% width which isn't looking neat or matching the styleguide.

I noticed inconsistency of the select element on the Installation page, this is stylistic change which I'd leave for others to discussion on.

I've added a patch targeting the overflow of select box on mobile devices.

Sumit kumar’s picture

Status: Needs review » Needs work
manjit.singh’s picture

@skippednote Have you test #1 patch, I think this patch is just for Installation screen and not effecting other select boxes.

deepakkumar14’s picture

I have tested the patch #1 on my local machine.
Its working fine for configuration page and not effect any othe select list.

manjit.singh’s picture

Status: Needs work » Needs review
Issue tags: +Needs screenshots

@deepak It would be good if you can attach some screenshots from mobile as well. Because issue was on mobile.

deepakkumar14’s picture

StatusFileSize
new109.33 KB

I have tested also on mobile and its working fine.

vipulaSD’s picture

StatusFileSize
new462 bytes

Re-rolled patch for commit 7f1b02ecd93c08e82a4020b8cec500fde718594e.

meeli’s picture

StatusFileSize
new171.23 KB

This patch is looking food but I wanted to point out that I think the select fields should look consistent - the timezone field not doesn't match the country field and I think they should both be

width: 100%;
max-width: 100%;

so that they both look and act the same across different breakpoints.

Added a screenshot of the two fields at different widths.

studiozut’s picture

Assigned: Unassigned » studiozut
studiozut’s picture

I'm about to look at this issue at DrupalCon LA

manjit.singh’s picture

Issue tags: +frontend, +CSS
studiozut’s picture

StatusFileSize
new672 bytes

I added a width and max-width 100% (per @meeli's suggestion) to the existing media query in form.css for "narrow devices". This should extend the select box fields the width of the device for handheld.

studiozut’s picture

StatusFileSize
new251.3 KB

Adding a screenshot to comment #19

select box screenshot

studiozut’s picture

Assigned: studiozut » Unassigned
lewisnyman’s picture

Status: Needs review » Needs work
+++ b/core/themes/seven/css/components/form.css
@@ -303,6 +300,10 @@ select {
+  #edit-site-default-country, #edit-date-default-timezone {
+    width: 100%;
+    max-width: 100%;
+  }

Can we not use ID's to select individual elements? We should try and avoid overriding elements in one situation. Is it possible to apply this CSS to all select boxes? I think that would be ok behaviour.

manjit.singh’s picture

StatusFileSize
new606 bytes

adding .form-selectinstead of #edit-site-default-country, #edit-date-default-timezone

But @lewis, May be it causes a problem for other forms also.. we have to check that manually :)

manjit.singh’s picture

Status: Needs work » Needs review
lamaxi’s picture

I made 4 screens for two custom width (360 and 570 pixels)

lamaxi’s picture

Assigned: Unassigned » lamaxi
lamaxi’s picture

Issue tags: +dcuacs2015
volodymyr.oliinyk’s picture

Assigned: lamaxi » Unassigned
lewisnyman’s picture

Status: Needs review » Needs work

I tested this patch on a few other pages and it doesn't have any bad effects, it simply makes the select element full width. This is overidden correctly on pages that float or set widths on their form items as the select element only fills the maximum width of the .form-item wrapper div.

One question:

+++ b/core/themes/seven/css/components/form.css
@@ -196,11 +196,8 @@ textarea.form-textarea {
- * Limits extra long instances of select elements to the max width allowed
- * to avoid breaking layouts.
- */
-select {
+
+.form-select {
   max-width: 100%;
 }

I'm not sure why we are removing this comment?

simply021’s picture

Assigned: Unassigned » simply021
simply021’s picture

Assigned: simply021 » Unassigned
StatusFileSize
new4.1 KB
new189.38 KB
new122.25 KB

Reverting comment for

.form-select

and applying width value

max-width: 100%;

.

simply021’s picture

Reverting comment for

.form-select

and applying width value

max-width: 100%;

.

simply021’s picture

Status: Needs work » Needs review
manjit.singh’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new499.86 KB

I have checked it on emulators and working fine for me. Please check the screenshot.

After applying patch:

select

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 32: select-mobile-2392729-32.patch, failed testing.

ejb503’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new141.6 KB

Hi I've applied the patch from 32 on my local and rerun all tests and they are passing without problems,

catch’s picture

Status: Reviewed & tested by the community » Needs work

The patch in #32 has 9 fails, so should not be RTBC. Looks like unrelated changes that could be removed.

Sumit kumar’s picture

Status: Needs work » Needs review
Issue tags: +drupalconasia2016
StatusFileSize
new331 bytes
emma.maria’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Novice

The patch in #39 is a different solution to the work in the patch at #32 which was RTBC.

The patch in #32 contained unrelated changes for this issue, there should only be changes to the form.css file.

Please can someone take the patch in #32 remove the unrelated changes and upload a new patch please?

Thanks :)

alvimurtaza’s picture

Status: Needs work » Needs review
StatusFileSize
new577 bytes
new217.71 KB

Adding patch with the fix for mobile viewport.

manjit.singh’s picture

Version: 8.0.x-dev » 8.2.x-dev
jeffrey.vargas’s picture

I'm working on this in the Mentor Sprints at DrupalCon NOLA 2016.

Confirmed against Drupal 8.2.x-dev.

vsawant’s picture

I am working on this at Core sprint at DrupalCon New Orleans

jeffrey.vargas’s picture

Confirmed that this addresses the issues raised by emma.maria and only has changes to the form.css file.

vsawant’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.13 MB

I have reviewed #41. It applies cleanly to brach 8.2.x I can verify that it fixes the issue with width of select boxes in mobile view.
And also additional unrelated changes in #32 have been removed. I believe this is RTBC

jeffrey.vargas’s picture

RTBC +1. Reviewed and tested locally and ran dreditor to confirm that the fix works and conforms to changes only in form.css file.

star-szr’s picture

Assigned: Unassigned » star-szr
star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs review
+++ b/core/themes/seven/css/components/form.css
@@ -207,7 +207,7 @@ textarea.form-textarea {
-select {
+.form-select {

@@ -310,6 +310,9 @@ select {
+  .form-select {
+    width: 100%;
+  }

I might be missing something but I'm not sure why are we changing the first selector here and why the second selector is .form-select instead of select. I don't see it being discussed here so I am asking :)

manjit.singh’s picture

StatusFileSize
new277.05 KB

@Cottser Don't know the answer but we can take anything .form-select or select because both are pointing to the same element. If you want, I can change the selector.

I have captured a screenshot for reference to others.

sdf

maninders’s picture

Assigned: Unassigned » maninders
maninders’s picture

StatusFileSize
new108.63 KB

This is working fine after applying patch #41.
Screenshot is attached for your reference.

maninders’s picture

Issue summary: View changes
maninders’s picture

Issue summary: View changes
maninders’s picture

Assigned: maninders » Unassigned
Status: Needs review » Reviewed & tested by the community
star-szr’s picture

Component: CSS » Seven theme
Status: Reviewed & tested by the community » Needs work

I think in that case we should use select as the (base of the) selector then.

Thanks for the manual testing @Maninders but we were just discussing whether it's the right solution a few comments ago.

manjit.singh’s picture

Issue tags: +Needs themer review

I think we have to keep select rather than .form-select

maninders’s picture

alvimurtaza’s picture

Status: Needs work » Needs review
StatusFileSize
new363 bytes

Updating the patch with adding style using html selector instead of the class.

Trupti Bhosale’s picture

StatusFileSize
new105.3 KB
new92.35 KB

Verified the patch 'select-box-issue-in-configuration-page-on-mobile-2392729-59.patch' and the size of 'Default time zone' is now 100%.
Attaching snapshots for reference.

Trupti Bhosale’s picture

Status: Needs review » Reviewed & tested by the community
manjit.singh’s picture

Looks good to me, Thanks.

xjm’s picture

Issue tags: +rc deadline

A UI bugfix like this should be eligible during the 8.2.x beta. After that it can still go into 8.3.x.

star-szr’s picture

Assigned: Unassigned » star-szr

Assigning for review.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Status: Reviewed & tested by the community » Needs work
star-szr’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated test failure.

  • Cottser committed b184ba6 on 8.3.x
    Issue #2392729 by AlviMurtaza, Sumit kumar, Manjit.Singh, simply021,...

  • Cottser committed 4ab99e3 on 8.2.x
    Issue #2392729 by AlviMurtaza, Sumit kumar, Manjit.Singh, simply021,...
star-szr’s picture

Title: Select box issue in configuration page on mobile » Optimize Seven's select boxes for small screens
Version: 8.3.x-dev » 8.2.x-dev
Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs screenshots

Committed and pushed b184ba6 to 8.3.x and 4ab99e3 to 8.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Vidushi Mehta’s picture

lewisnyman’s picture