Skip to content

Commit b5d3ac4

Browse files
committed
don't show check icon if selectMultipleWithCtrl
1 parent 0ced320 commit b5d3ac4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

web/dropdown.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Dropdown {
6464
this.currentValueElem = this.elem.appendChild(document.createElement('div'));
6565
this.currentValueElem.className = 'dropdownCurrentValue';
6666

67-
alterClass(this.elem, 'multi', (multipleAllowed));
67+
alterClass(this.elem, 'multi', (multipleAllowed && !selectMultipleWithCtrl));
6868
this.elem.appendChild(this.menuElem);
6969

7070
document.addEventListener('click', (e) => {
@@ -237,7 +237,7 @@ class Dropdown {
237237
for (let i = 0; i < this.options.length; i++) {
238238
const escapedName = escapeHtml(this.options[i].name);
239239
html += '<div class="dropdownOption' + (this.optionsSelected[i] ? ' ' + CLASS_SELECTED : '') + '" data-id="' + i + '" title="' + escapedName + '">' +
240-
(this.multipleAllowed && this.optionsSelected[i] ? '<div class="dropdownOptionMultiSelected">' + SVG_ICONS.check + '</div>' : '') +
240+
((this.multipleAllowed && !this.selectMultipleWithCtrl) && this.optionsSelected[i] ? '<div class="dropdownOptionMultiSelected">' + SVG_ICONS.check + '</div>' : '') +
241241
escapedName + (typeof this.options[i].hint === 'string' && this.options[i].hint !== '' ? '<span class="dropdownOptionHint">' + escapeHtml(this.options[i].hint!) + '</span>' : '') +
242242
(this.showInfo ? '<div class="dropdownOptionInfo" title="' + escapeHtml(this.options[i].value) + '">' + SVG_ICONS.info + '</div>' : '') +
243243
'</div>';
@@ -250,7 +250,7 @@ class Dropdown {
250250
// Width must be at least 138px for the filter element.
251251
// Don't need to add 12px if showing (info icons or multi checkboxes) and the scrollbar isn't needed. The scrollbar isn't needed if: menuElem height + filter input (25px) < 297px
252252
const menuElemRect = this.menuElem.getBoundingClientRect();
253-
this.currentValueElem.style.width = Math.max(Math.ceil(menuElemRect.width) + ((this.showInfo || this.multipleAllowed) && menuElemRect.height < 272 ? 0 : 12), 138) + 'px';
253+
this.currentValueElem.style.width = Math.max(Math.ceil(menuElemRect.width) + ((this.showInfo || (this.multipleAllowed && !this.selectMultipleWithCtrl)) && menuElemRect.height < 272 ? 0 : 12), 138) + 'px';
254254
this.menuElem.style.cssText = 'right:0; overflow-y:auto; max-height:297px;'; // Max height for the dropdown is [filter (31px) + 9.5 * dropdown item (28px) = 297px]
255255
if (this.dropdownVisible) this.filter();
256256
}
@@ -295,8 +295,6 @@ class Dropdown {
295295
let change = false;
296296
let doubleClick = this.doubleClickTimeout !== null && this.lastClicked === option;
297297
if (this.doubleClickTimeout !== null) this.clearDoubleClickTimeout();
298-
// eslint-disable-next-line no-console
299-
console.log('test');
300298
if (doubleClick) {
301299
// Double click
302300
if ((this.multipleAllowed) && option === 0) {

0 commit comments

Comments
 (0)