Skip to content

Commit

Permalink
* dropdown: fix dropdown button not work.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Jul 16, 2024
1 parent 36fc722 commit 9eb69ac
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/dropdown/src/component/dropdown-button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {createRef} from 'preact';
import {$} from '@zui/core';
import {Button} from '@zui/button/src/component/button';
import {BtnGroup} from '@zui/btn-group/src/component';
import {Toolbar} from '@zui/toolbar/src/component';
Expand All @@ -20,7 +19,6 @@ export class DropdownButton extends Button<DropdownButtonOptions> {

_updateData() {
const {dropdown, menu, items, onClickItem, relativeTarget = this.triggerElement} = this.props;
const $trigger = $(this.triggerElement);
const instance = Dropdown.get(this.triggerElement);
const options = {
items,
Expand All @@ -32,7 +30,7 @@ export class DropdownButton extends Button<DropdownButtonOptions> {
if (instance) {
instance.setOptions(options);
} else {
$trigger.data(options);
new Dropdown(this.triggerElement, options);
}
}

Expand Down

0 comments on commit 9eb69ac

Please sign in to comment.