Select2 visual bug fix (#4207) * attempt at fixing select2 spacing issue across browsers * found the actual problem * fixing placeholder text * fixing placeholder text again * removing references to the select2_multi_sameline --------- Co-authored-by: qvink <qvink@users.noreply.github.com>

b3bc065713564600e9eff223defa75228cef64d7

qvink <191186569+qvink@users.noreply.github.com>

Signed
3 files changed, +9 -62Ignore whitespace
public/css/select2-overrides.css+5 -57
@@ -19,14 +19,14 @@
19.select2-container .select2-selection .select2-selection__clear {19.select2-container .select2-selection .select2-selection__clear {
20 color: var(--SmartThemeBodyColor);20 color: var(--SmartThemeBodyColor);
21 font-size: 20px;21 font-size: 20px;
22 padding: 0;
23 position: absolute;22 position: absolute;
24 right: 5px;23 right: 5px;
25 top: 0;24 margin-top: 0; /* compensate for the increased font size */
26}25}
2726
28.select2-container .select2-search__field {27.select2-container .select2-search--inline textarea.select2-search__field {
29 opacity: 0.8;28 opacity: 0.8;
29 margin-top: 7px; /* get placeholder text to the center */
30}30}
3131
32.select2-selection--single .select2-selection__placeholder {32.select2-selection--single .select2-selection__placeholder {
@@ -63,9 +63,10 @@
63 background-color: var(--black30a);63 background-color: var(--black30a);
64 color: var(--SmartThemeBodyColor);64 color: var(--SmartThemeBodyColor);
65 border: 1px solid var(--SmartThemeBorderColor);65 border: 1px solid var(--SmartThemeBorderColor);
66 border-radius: 7px;
67 font-family: var(--mainFontFamily);66 font-family: var(--mainFontFamily);
68 padding: 3px 5px;67 padding: 3px 5px;
68 display: unset; /* override the ST textarea display style */
69 border-radius: 0; /* border radius was interfering with cursor */
69}70}
7071
71/* Customize the selected option */72/* Customize the selected option */
@@ -93,7 +94,6 @@
93 border: 1px solid var(--SmartThemeBorderColor);94 border: 1px solid var(--SmartThemeBorderColor);
94 border-radius: 7px;95 border-radius: 7px;
95 font-family: var(--mainFontFamily);96 font-family: var(--mainFontFamily);
96 padding: 3px 5px;
97}97}
9898
99.select2-container.select2-container--focus .select2-selection--multiple,99.select2-container.select2-container--focus .select2-selection--multiple,
@@ -230,55 +230,3 @@ span.select2.select2-container .select2-selection__choice__remove:hover {
230.select2_choice_clickable_buttonstyle+span.select2-container .select2-selection__choice__display:hover {230.select2_choice_clickable_buttonstyle+span.select2-container .select2-selection__choice__display:hover {
231 background-color: var(--white30a);231 background-color: var(--white30a);
232}232}
233
234/* Custom class to support same line multi inputs of select2 controls */
235.select2_multi_sameline+span.select2-container .select2-selection--multiple {
236 display: flex;
237 flex-wrap: wrap;
238}
239
240.select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-search--inline {
241 /* Allow search placeholder to take up all space if needed */
242 flex-grow: 1;
243}
244
245.select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-selection__rendered {
246 /* Fix weird styling choice or huge margin around selected options */
247 margin-block-start: 2px;
248 margin-block-end: 2px;
249 display: flex;
250 align-items: center;
251 flex-wrap: wrap;
252 row-gap: 5px;
253}
254
255.select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-selection__choice {
256 margin-top: 0px;
257}
258
259.select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-search__field {
260 /* Min height to reserve spacing */
261 min-height: calc(var(--mainFontSize) + 13px);
262 /* Min width to be clickable */
263 min-width: 4em;
264 align-content: center;
265 /* Fix search textarea alignment issue with UL elements */
266 margin-top: 0px;
267 height: unset;
268 /* Prevent height from jumping around when input is focused */
269 line-height: 1;
270}
271
272.select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-selection__rendered {
273 /* Min height to reserve spacing */
274 min-height: calc(var(--mainFontSize) + 13px);
275}
276
277/* Make search bar invisible unless the select2 is active, to save space */
278.select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-search--inline {
279 height: 1px;
280}
281
282.select2_multi_sameline+span.select2-container.select2-container--focus .select2-selection--multiple .select2-search--inline {
283 height: unset;
284}
public/css/world-info.css+0 -1
@@ -107,7 +107,6 @@
107 height: auto;107 height: auto;
108 margin-top: 0;108 margin-top: 0;
109 margin-bottom: 0;109 margin-bottom: 0;
110 min-height: calc(var(--mainFontSize) + 14px);
111}110}
112111
113.delete_entry_button {112.delete_entry_button {
public/index.html+4 -4
@@ -4307,7 +4307,7 @@
4307 </span>4307 </span>
4308 </div>4308 </div>
4309 <div class="range-block-range">4309 <div class="range-block-range">
4310 <select id="world_info" class="select2_multi_sameline" multiple>4310 <select id="world_info" multiple>
4311 <option value="" data-i18n="-- World Info not found --">-- World Info not found -- </option>4311 <option value="" data-i18n="-- World Info not found --">-- World Info not found -- </option>
4312 </select>4312 </select>
4313 </div>4313 </div>
@@ -6273,7 +6273,7 @@
6273 </span>6273 </span>
6274 </small>6274 </small>
6275 <small class="textAlignCenter" data-i18n="Primary Keywords">Primary Keywords</small>6275 <small class="textAlignCenter" data-i18n="Primary Keywords">Primary Keywords</small>
6276 <select class="keyprimaryselect keyselect select2_multi_sameline" name="key" data-i18n="[placeholder]Keywords or Regexes" placeholder="Keywords or Regexes" multiple="multiple"></select>6276 <select class="keyprimaryselect keyselect" name="key" data-i18n="[placeholder]Keywords or Regexes" placeholder="Keywords or Regexes" multiple="multiple"></select>
6277 <textarea class="text_pole keyprimarytextpole mobile" name="key" rows="1" data-i18n="[placeholder]Comma separated list" placeholder="Comma separated list" style="display: none;"></textarea>6277 <textarea class="text_pole keyprimarytextpole mobile" name="key" rows="1" data-i18n="[placeholder]Comma separated list" placeholder="Comma separated list" style="display: none;"></textarea>
6278 <button type="button" class="switch_input_type_icon" tabindex="-1" title="Switch to plaintext mode" data-i18n="[title]Switch to plaintext mode" data-icon-on="✨" data-icon-off="⌨️" data-tooltip-on="Switch to fancy mode" data-tooltip-off="Switch to plaintext mode">6278 <button type="button" class="switch_input_type_icon" tabindex="-1" title="Switch to plaintext mode" data-i18n="[title]Switch to plaintext mode" data-icon-on="✨" data-icon-off="⌨️" data-tooltip-on="Switch to fancy mode" data-tooltip-off="Switch to plaintext mode">
6279 ⌨️6279 ⌨️
@@ -6295,7 +6295,7 @@
6295 </span>6295 </span>
6296 </small>6296 </small>
6297 <small class="textAlignCenter" data-i18n="Optional Filter">Optional Filter</small>6297 <small class="textAlignCenter" data-i18n="Optional Filter">Optional Filter</small>
6298 <select class="keysecondaryselect keyselect select2_multi_sameline" name="keysecondary" data-i18n="[placeholder]Keywords or Regexes (ignored if empty)" placeholder="Keywords or Regexes (ignored if empty)" multiple="multiple"></select>6298 <select class="keysecondaryselect keyselect" name="keysecondary" data-i18n="[placeholder]Keywords or Regexes (ignored if empty)" placeholder="Keywords or Regexes (ignored if empty)" multiple="multiple"></select>
6299 <textarea class="text_pole keysecondarytextpole mobile" name="keysecondary" rows="1" data-i18n="[placeholder]Comma separated list (ignored if empty)" placeholder="Comma separated list (ignored if empty)" style="display: none;"></textarea>6299 <textarea class="text_pole keysecondarytextpole mobile" name="keysecondary" rows="1" data-i18n="[placeholder]Comma separated list (ignored if empty)" placeholder="Comma separated list (ignored if empty)" style="display: none;"></textarea>
6300 <button type="button" class="switch_input_type_icon" tabindex="-1" title="Switch to plaintext mode" data-i18n="[title]Switch to plaintext mode" data-icon-on="✨" data-icon-off="⌨️" data-tooltip-on="Switch to fancy mode" data-tooltip-off="Switch to plaintext mode">6300 <button type="button" class="switch_input_type_icon" tabindex="-1" title="Switch to plaintext mode" data-i18n="[title]Switch to plaintext mode" data-icon-on="✨" data-icon-off="⌨️" data-tooltip-on="Switch to fancy mode" data-tooltip-off="Switch to plaintext mode">
6301 ⌨️6301 ⌨️
@@ -6482,7 +6482,7 @@
6482 </label>6482 </label>
6483 </div>6483 </div>
6484 <div class="range-block-range">6484 <div class="range-block-range">
6485 <select name="characterFilter" class="select2_multi_sameline" multiple>6485 <select name="characterFilter" multiple>
6486 <option value="" data-i18n="-- Characters not found --">6486 <option value="" data-i18n="-- Characters not found --">
6487 -- Characters not found --6487 -- Characters not found --
6488 </option>6488 </option>