Bug 36897 - Make it possible to use select[multiple] and select[size] in a sidebar
Summary: Make it possible to use select[multiple] and select[size] in a sidebar
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Phil Ringnalda
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-17 16:30 UTC by Phil Ringnalda
Modified: 2024-10-04 00:50 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 36897: Make it possible to use select[multiple] and select[size] in a sidebar (1.82 KB, patch)
2024-05-17 20:29 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 36897: Make it possible to use select[multiple] and select[size] in a sidebar (1.87 KB, patch)
2024-05-20 13:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36897: Make it possible to use select[multiple] and select[size] in a sidebar (2.52 KB, patch)
2024-10-04 00:47 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 36897: Make it possible to use select[multiple] and select[size] in a sidebar (2.56 KB, patch)
2024-10-04 00:50 UTC, Phil Ringnalda
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2024-05-17 16:30:36 UTC
https://git.koha-community.org/Koha-community/Koha/src/commit/1ea4a11c2a88f7b23b482e071db48ae235beb42b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss#L240 sets the height of aside fieldset select to a calculated "one fat line" which is fine for <select>, but for <select multiple> and <select size="10"> it turns what should be a multiline box into one line with a nearly invisible scrollbar.

The fix is simple, a rule (like the one that exists in bootstrap.scss, which isn't specific enough to overrule the aside fieldset select rule) right after that for

select[multiple], select[size] {
    height: auto;
}

but I don't quite know how to formulate a test plan for something unused other than by the advanced cataloging editor, which is working around the problem in bug 36589.
Comment 1 Phil Ringnalda 2024-05-17 20:29:33 UTC Comment hidden (obsolete)
Comment 2 Phil Ringnalda 2024-05-17 20:30:28 UTC
I use devtools to edit CSS all the time, but apparently I either never noticed it had an HTML editor, or forgot about it.
Comment 3 Owen Leonard 2024-05-20 13:28:09 UTC
Created attachment 166937 [details] [review]
Bug 36897: Make it possible to use select[multiple] and select[size] in a sidebar

Currently, if you put either <select multiple> or <select size="10"> in
an <aside><fieldset> sidebar, you get a height of "one fat line" rather
than the bigger box you would expect.

Test plan:
 1. Without the patch, load Reports - Use saved
 2. Open Firefox developer tools to the Inspector tab
 3. With the "Pick an element from the page" tool, click on the word
    "Filter" in the Reports page's sidebar
 4. Just above that line in the HTML display is a <fieldset
    class="brief"> - right click that and choose Edit As HTML
 5. After the fieldset element, paste

<select multiple><option>one</option><option>two</option></select><select size="10"></select>

 6. Click outside the editor to save your changes
 7. Note that both new selects are only one line high
 8. Apply patch, run yarn build, Shift+reload to clear your cache
 9. Repeat steps 3 through 6
10. Note that both selects are more than one line high

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Lucas Gass (lukeg) 2024-08-27 15:59:57 UTC
> but I don't quite know how to formulate a test plan for something unused
> other than by the advanced cataloging editor, which is working around the
> problem in bug 36589.

If this is unused why do we need related CSS in Koha?
Comment 5 Phil Ringnalda 2024-08-27 18:59:16 UTC
Because our existing CSS is wrong, and we don't want the next person who puts a multiple or sized <select> in a sidebar to have to figure out how it is wrong, and how to work around it being wrong.

What the selector above the one added by this patch really meant was "select:not(multiple size)" (untested, I don't use :not() often), but since :not() is tricksy and expensive, it makes more sense to fix the wrongness by just adding a second selector to undo it when it shouldn't apply.
Comment 6 Phil Ringnalda 2024-08-28 19:36:19 UTC
Given that bug 36589 has made it to oldstable, and doesn't much look like it's going any further, I could add in reverting the patch for it, if that helps make this more attractive.
Comment 7 Phil Ringnalda 2024-10-04 00:47:49 UTC Comment hidden (obsolete)
Comment 8 Phil Ringnalda 2024-10-04 00:50:03 UTC
Created attachment 172376 [details] [review]
Bug 36897: Make it possible to use select[multiple] and select[size] in a sidebar

Currently, if you put either <select multiple> or <select size="10"> in
an <aside><fieldset> sidebar, you get a height of "one fat line" rather
than the bigger box you would expect.

Test plan:
 1. Without the patch, load Reports - Use saved
 2. Open Firefox developer tools to the Inspector tab
 3. With the "Pick an element from the page" tool, click on the word
    "Filter" in the Reports page's sidebar
 4. Just above that line in the HTML display is a <fieldset
    class="brief"> - right click that and choose Edit As HTML
 5. After the fieldset element, paste

<select multiple><option>one</option><option>two</option></select><select size="10"></select>

 6. Click outside the editor to save your changes
 7. Note that both new selects are only one line high
 8. Apply patch, run yarn build, Shift+reload to clear your cache
 9. Repeat steps 3 through 6
10. Note that both selects are more than one line high
11. Set the preference EnableAdvancedCatalogingEditor to Enable
12. Cataloging - Advanced editor
13. In the left sidebar, verify that the Clipboard is still 10 lines high,
    not one fat line like it was before bug 36589

Sponsored-by: Chetco Community Public Library