Bug 28611

Summary: Incorrect Select2 width
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: CatalogingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dcook, fridolin.somers, katrin.fischer, kyle, m.de.rooy, oleonard, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.02,20.11.09
Bug Depends on:    
Bug Blocks: 35245    
Attachments: Bug 28611: Fix width to 50% for additem form elements
Bug 28611: Fix width to 50% for additem form elements
Bug 28611: Fix width to 50% for additem form elements
Bug 28611: Fix width to 50% for additem form elements
Screenshot of item form pull downs in 20.11

Description Jonathan Druart 2021-06-22 09:46:06 UTC
The width picked by Select2 is not correct, the longest option's size is used but:
 * it is sometimes split on two lines
 * the close button hides the end of the value

https://snipboard.io/v4P7HN.jpg
Comment 1 Jonathan Druart 2021-06-22 09:47:57 UTC
Created attachment 122276 [details] [review]
Bug 28611: Fix width to 50% for additem form elements

This patch suggests to set the width of select and input to 50%
Comment 2 Jonathan Druart 2021-06-22 09:49:01 UTC
With this patch applied: https://snipboard.io/rME6z3.jpg
Comment 3 Owen Leonard 2021-06-24 14:00:06 UTC
Created attachment 122390 [details] [review]
Bug 28611: Fix width to 50% for additem form elements

This patch suggests to set the width of select and input to 50%

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Katrin Fischer 2021-07-05 20:33:35 UTC
Created attachment 122591 [details] [review]
Bug 28611: Fix width to 50% for additem form elements

This patch suggests to set the width of select and input to 50%

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2021-07-05 20:38:39 UTC
Created attachment 122592 [details] [review]
Bug 28611: Fix width to 50% for additem form elements

This patch suggests to set the width of select and input to 50%

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2021-07-05 20:42:58 UTC
We know this is not the perfect solution, but until Select2 works better, I think this will be an improvement.
Comment 7 Jonathan Druart 2021-07-06 09:06:21 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 8 Kyle M Hall 2021-07-09 17:51:56 UTC
Pushed to 21.05.x for 21.05.02
Comment 9 Fridolin Somers 2021-08-02 20:48:59 UTC
It is a big visual change on items editor.
I propose not to impact older versions.
Comment 10 Katrin Fischer 2021-08-06 23:46:43 UTC
I understand the argument, but the visual was already changed by the newer version of select2 that made the input fields too short in many cases. I have seen library pull downs only showing like 3 letters of the branch names :(
Comment 11 Katrin Fischer 2021-08-06 23:53:48 UTC
Created attachment 123590 [details]
Screenshot of item form pull downs in 20.11

(In reply to Katrin Fischer from comment #10)
> I understand the argument, but the visual was already changed by the newer
> version of select2 that made the input fields too short in many cases. I
> have seen library pull downs only showing like 3 letters of the branch names
> :(

To explain a bit more, it means that currently you can't figure out the library actually selected, if you have some starting with the same letters.

Also the X is too close to text, so I often have it happen that when I want to open the pull down, I actually empty the field. 

The screenshot shows the problematic classification source, home branch and holding branch selects on current 20.11.6
Comment 12 Fridolin Somers 2021-08-07 07:22:14 UTC
Oh crap, a real ergonomic bug then. I backport.

The backport on 20.11 actually fails because there is on select tag the attribute size="1".
This has been removed in 21.05.x by Bug 28066.

Should we keep it or remove it ?
Comment 13 Katrin Fischer 2021-08-07 14:07:30 UTC
(In reply to Fridolin Somers from comment #12)
> Oh crap, a real ergonomic bug then. I backport.
> 
> The backport on 20.11 actually fails because there is on select tag the
> attribute size="1".
> This has been removed in 21.05.x by Bug 28066.
> 
> Should we keep it or remove it ?

I believe removing it would be ok, but leaving it in probably won't cause issues right away either.
Comment 14 Fridolin Somers 2021-08-13 19:38:10 UTC
(In reply to Katrin Fischer from comment #13)
> (In reply to Fridolin Somers from comment #12)
> > Oh crap, a real ergonomic bug then. I backport.
> > 
> > The backport on 20.11 actually fails because there is on select tag the
> > attribute size="1".
> > This has been removed in 21.05.x by Bug 28066.
> > 
> > Should we keep it or remove it ?
> 
> I believe removing it would be ok, but leaving it in probably won't cause
> issues right away either.

Ok I choose to keep it.
Thanks for your help ;)
Comment 15 Fridolin Somers 2021-08-13 19:39:34 UTC
Pushed to 20.11.x for 20.11.09
Comment 16 Victor Grousset/tuxayo 2021-08-16 21:07:35 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.
Comment 17 David Cook 2021-11-10 01:32:03 UTC
(In reply to Katrin Fischer from comment #10)
> I understand the argument, but the visual was already changed by the newer
> version of select2 that made the input fields too short in many cases. I
> have seen library pull downs only showing like 3 letters of the branch names
> :(

I just saw this for the first time today and it's driving me crazy...
Comment 18 Katrin Fischer 2021-11-10 09:58:34 UTC
(In reply to David Cook from comment #17)
> (In reply to Katrin Fischer from comment #10)
> > I understand the argument, but the visual was already changed by the newer
> > version of select2 that made the input fields too short in many cases. I
> > have seen library pull downs only showing like 3 letters of the branch names
> > :(
> 
> I just saw this for the first time today and it's driving me crazy...

We set them to a wide width by default here, still waiting for aproper fix in the library I think.