Skip to content

Commit

Permalink
docs: update demo (ant-design#46006)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ authored Nov 22, 2023
1 parent 0cb771d commit e5a6966
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/dropdown/demo/overlay-open.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { DownOutlined } from '@ant-design/icons';
import type { MenuProps } from 'antd';
import type { DropdownProps, MenuProps } from 'antd';
import { Dropdown, Space } from 'antd';

const App: React.FC = () => {
Expand All @@ -12,8 +12,10 @@ const App: React.FC = () => {
}
};

const handleOpenChange = (flag: boolean) => {
setOpen(flag);
const handleOpenChange: DropdownProps['onOpenChange'] = (nextOpen, info) => {
if (info.source === 'trigger' || nextOpen) {
setOpen(nextOpen);
}
};

const items: MenuProps['items'] = [
Expand Down

0 comments on commit e5a6966

Please sign in to comment.