Browse Source

Fix multiselect crashing in certain circumstances

master
Andrew Kingston 6 years ago
parent
commit
2fa42d194b
  1. 9
      packages/builder/src/components/common/MultiSelect.svelte

9
packages/builder/src/components/common/MultiSelect.svelte

@ -61,6 +61,9 @@
function handleOptionMousedown(e) { function handleOptionMousedown(e) {
const value = e.target.dataset.value const value = e.target.dataset.value
if (value == null) {
return
}
if (selected[value]) { if (selected[value]) {
remove(value) remove(value)
} else { } else {
@ -118,7 +121,7 @@
</li> </li>
{/each} {/each}
{#if !options.length} {#if !options.length}
<li>No results</li> <li class="no-results">No results</li>
{/if} {/if}
</ul> </ul>
{/if} {/if}
@ -264,6 +267,10 @@
li:not(.selected):hover { li:not(.selected):hover {
background-color: var(--grey-1); background-color: var(--grey-1);
} }
li.no-results:hover {
background-color: white;
cursor: initial;
}
.hidden { .hidden {
display: none; display: none;

Loading…
Cancel
Save