Review main Merged

67247[BUGFIX] Use `form-select` class for <select> fields

Andreas Kienast CR +2 V +2 Hard +131 −176 updated 01/04/21, 13:53

Commit message

With Bootstrap 5, <select> fields make use of the class `form-select`.
This patch aims to replace every occurrence of `form-control` used with
select fields. Since Bootstrap finally brings proper styling for select
boxes, the custom implementation rendering chevrons can be removed.

In the same run, the `input-$size` classes are migrated to its new class
names and some obsolete classes have been removed.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Martin Kutschker +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Martin Kutschker +1
    • TYPO3com +1 CI

Issues 1

Files 67

Show 47 more files

Review log 2939

Show 914 earlier messages
  1. Andreas Kienast uploaded patch set 1 12/23/20, 09:35

  2. TYPO3com voted on patch set 1 V -1 12/23/20, 09:47 Completed build in 10m 58s on Wed, 23 Dec, 09:47 AM Test Summary: 31472 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8454

  3. Andreas Kienast uploaded patch set 2 12/23/20, 10:52

  4. TYPO3com voted on patch set 2 V -1 12/23/20, 11:03 Completed build in 10m 44s on Wed, 23 Dec, 11:03 AM Test Summary: 1 of 32781 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8455

  5. TYPO3com voted on patch set 2 V +1 12/23/20, 11:32 Completed build in 50m 34s on Wed, 23 Dec, 11:32 AM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8455

  6. Oliver Klee updated the commit message in patch set 3 12/23/20, 16:07

  7. TYPO3com voted on patch set 3 V +1 12/23/20, 16:17 Completed build in 09m 49s on Wed, 23 Dec, 04:17 PM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8459

  8. Andreas Kienast uploaded patch set 4 12/28/20, 12:47

  9. Guido Schmechel commented on patch set 4 12/28/20, 12:53

    Pagination.html:49

    Is it OK from a GIT point of view to change this? We are actually only talking about form-select. Could the history complicate things a bit? Of course, no issue in terms of content
  10. TYPO3com voted on patch set 4 V +1 12/28/20, 12:58 Completed build in 10m 12s on Mon, 28 Dec, 12:58 PM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8471

  11. Guido Schmechel commented on patch set 4 12/28/20, 13:08

    Pagination.html:49 Reply

    Okay. I can live with it being in the commit message ;-)
  12. Andreas Kienast commented on patch set 4 12/28/20, 13:08

    Pagination.html:49 Reply

    Yes and no. Strictly speaking, you're right. OTOH, I have to fix these occurrences for select fields as well, anyway. I have no strong opinion here, whether we keep these changes or push a new patch.
  13. Guido Schmechel voted on patch set 4 V +1 CR +1 12/28/20, 13:08

  14. Benjamin Franzke wrote 12/28/20, 19:57

    Topic set to bootstrap5
  1. Benjamin Franzke commented on patch set 4 CR -1 12/28/20, 20:04

    There are still some occurrences left. Please checkout: git grep "select.*form-control" | grep -v -E "backend.css|form.css|__esModule" | sed 's/:.*//' | uniq Build/Sources/Sass/typo3/_main_form.scss Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/SelectSingleElement.ts typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/Element/SelectSingleElement.js typo3/sysext/form/Resources/Public/JavaScript/Backend/FormManager/ViewModel.js typo3/sysext/scheduler/Classes/Task/ExecuteSchedulableCommandAdditionalFieldProvider.php
  2. Andreas Kienast commented on patch set 4 12/29/20, 10:19

    Reply

    Thanks a lot for that list. Some of the results are false-positives, as there is also a class called `form-control-wrap`.
  3. Andreas Kienast uploaded patch set 5 12/29/20, 10:19

  4. TYPO3com voted on patch set 5 V +1 12/29/20, 10:30 Completed build in 11m 02s on Tue, 29 Dec, 10:30 AM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8490

  5. Martin Kutschker commented on patch set 5 12/29/20, 20:54

    SelectSingleBoxElement.php:172

    This is the only file where the classes tceforms-select and tceforms-multiselect have not been removed. A slip?
  6. Martin Kutschker uploaded patch set 6 12/29/20, 21:01

  7. TYPO3com voted on patch set 6 V +1 12/29/20, 21:11 Completed build in 09m 55s on Tue, 29 Dec, 09:11 PM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8496

  8. Andreas Kienast commented on patch set 6 12/30/20, 06:56

    SelectSingleBoxElement.php:172 Reply

    This was kept on purpose, those strings aren't used as CSS classes anymore, but as a prefix for its id attribute.
  9. Martin Kutschker commented on patch set 6 CR +1 12/30/20, 10:24

    SelectSingleBoxElement.php:172 Reply

    Ack
  10. Benjamin Franzke uploaded patch set 7 12/30/20, 16:16

  11. TYPO3com voted on patch set 7 V +1 12/30/20, 16:26 Completed build in 09m 48s on Wed, 30 Dec, 04:26 PM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8509

  12. Benjamin Franzke commented on patch set 7 12/30/20, 16:27

    Reply

    Yup, thanks for taking care.

    _main_form.scss:194

    Does someone know why "width: 100% !important" is needed specially for fields with a size/multiple attribute? What makes them special to a regular select field? This means following will yield different stylings: <select class="form-select" size="1"></select> <select class="form-select"></select> This seems wrong and caused problems for pages.backend_layout (the input-group was wrapped because the select didn't properly flex because this 100% width). I have therefore added :not(.form-control-adapt) in patchset 7 to fix those fields where this class really explicitly asks for non-100% width, but better would be to remove this definitions.. History: it was introduced back in 2015 when FormEngine components where adapted to use bootstrap https://review.typo3.org/c/Packages/TYPO3.CMS/+/35951/35/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_main_form.less#64 – so I guess some special TCA thing may need(ed) this, but which? :)
  13. Andreas Kienast commented on patch set 7 12/31/20, 11:35

    _main_form.scss:194 Reply

    That's a really good question. I _think_ the original purpose in FormEngine was to require a full width for all select fields to have a consistent look&feel. IIRC FormEngine also always renders a size attribute, so it's pinned to that.
  14. Martin Kutschker commented on patch set 7 01/01/21, 19:34

    _main_form.scss:194 Reply

    I'm in the no-important camp, but I think if you add a comment .form-control-adapt to mark it as a temporary solution, it is ok. The patch is large enough. No need to make it more hzardous by removing a seemingly obsolete important.
  15. Benjamin Franzke uploaded patch set 8 01/04/21, 06:27

  16. Benjamin Franzke commented on patch set 8 01/04/21, 06:27

    _main_form.scss:194 Reply

    As this definition is just wrong and incompatible with bootstrap 5 css, I've now removed it. A select box is width 100% by default, so it's really not needed. And I don't want to introduce guessing comments here – if it really causes a bug, then that should be fixed later on with a more specific CSS selector, not a generic one, that attaches to *all* select fields.
  17. Benjamin Franzke commented on patch set 8 01/04/21, 06:29

    _main_form.scss:194 Reply

    Done

    Pagination.html:49 Reply

    I'd also agree, that this is fine to be done as drive-by.
  18. TYPO3com voted on patch set 8 V -1 01/04/21, 06:38 Completed build in 10m 24s on Mon, 4 Jan, 06:38 AM Test Summary: 1 of 32787 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8572

  19. TYPO3com voted on patch set 8 V +1 01/04/21, 07:00 Completed build in 09m 05s on Mon, 4 Jan, 07:00 AM Test Summary: 32546 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8574

  20. Martin Kutschker commented on patch set 8 01/04/21, 09:33

    _main_form.scss:194 Reply

    OK.
  21. Benjamin Franzke commented on patch set 8 01/04/21, 09:36

    _main_form.scss:194 Reply

    Did you mark it unresolved by intention? I guess that was by accident. Marking resolved again ;)
  22. Martin Kutschker commented on patch set 8 01/04/21, 13:05

    _main_form.scss:194 Reply

    Sorry, I thought that the checkbox is part of my message, not the state of the wohle thread.
  23. Martin Kutschker voted on patch set 8 V +1 CR +1 01/04/21, 13:38

  24. Benjamin Franzke voted on patch set 8 V +2 CR +2 01/04/21, 13:53

  25. Benjamin Franzke merged patch set 9 01/04/21, 13:53