Skip to content

onclose for Dropdown #1789

@sylv3rblade

Description

@sylv3rblade

Summary

Brief explanation of the feature.

similar to what is currently available to Modal that way we can hook functions when a Dropdown is closed

Basic example
If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable.

<script lang="ts">
function onclose() {
  console.log('Dropdown instance got closed')
  // do request based on what's selected from the closed dropdown
}
</script>

<Dropdown {onclose}>
  <DropdownItem>snip..</DropdownItem>
  <DropdownItem>snip..</DropdownItem>
</Dropdown>

<Dropdown {onclose}>
  <DropdownItem>snip..</DropdownItem>
  <DropdownItem>snip..</DropdownItem>
</Dropdown>

Motivation
Why are we doing this? What use cases does it support? What is the expected outcome?

We're using Dropdown in a similar case to MultiSelect (which has an onchange) but without the input

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions