fix(dropdown): allow clicking chevron to toggle menu

#251
This commit is contained in:
Eric Liu 2020-09-14 14:29:35 -07:00
commit 73861e2fa8
4 changed files with 5 additions and 4 deletions

View file

@ -275,7 +275,8 @@
open="{open}" /> open="{open}" />
{/if} {/if}
<ListBoxMenuIcon <ListBoxMenuIcon
on:click="{() => { on:click="{(e) => {
e.stopPropagation();
open = !open; open = !open;
}}" }}"
translateWithId="{translateWithId}" translateWithId="{translateWithId}"

View file

@ -36,6 +36,6 @@
class:bx--list-box__menu-icon="{true}" class:bx--list-box__menu-icon="{true}"
class:bx--list-box__menu-icon--open="{open}" class:bx--list-box__menu-icon--open="{open}"
{...$$restProps} {...$$restProps}
on:click|preventDefault|stopPropagation> on:click|preventDefault>
<ChevronDown16 aria-label="{description}" title="{description}" /> <ChevronDown16 aria-label="{description}" title="{description}" />
</div> </div>

View file

@ -20,7 +20,6 @@ export const Default = () => ({
id: text("MultiSelect id", "multi-select-id"), id: text("MultiSelect id", "multi-select-id"),
name: text("MultiSelect name", "multi-select-name"), name: text("MultiSelect name", "multi-select-name"),
titleText: text("Title (titleText)", "Multiselect Title"), titleText: text("Title (titleText)", "Multiselect Title"),
helperText: text("Helper text (helperText)", "This is not helper text"),
filterable: boolean("Filterable (filterable)", false), filterable: boolean("Filterable (filterable)", false),
selectionFeedback: select( selectionFeedback: select(
"Selection feedback (selectionFeedback)", "Selection feedback (selectionFeedback)",

View file

@ -405,7 +405,8 @@
open="{open}" /> open="{open}" />
{/if} {/if}
<ListBoxMenuIcon <ListBoxMenuIcon
on:click="{() => { on:click="{(e) => {
e.stopPropagation();
open = !open; open = !open;
}}" }}"
translateWithId="{translateWithId}" translateWithId="{translateWithId}"