problem description
Antd component uses dropdownRender
to customize the drop-down box content, the onClick ()
event added to the extra element has no effect, or is not sensitive (clicking 10
may take effect once).
anyone who has used Antd
has a look. Wait online. Hurry!
the environmental background of the problems and what methods you have tried
background (demand scenario):
sometimes when using the drop-down box component selection, if you don"t have the desired choice, you can add a add
button at the bottom to create new data, as shown in the following figure:
tried method:
- see
dropdownRender
in API. The receiving method has a second parameter, props(menuNode: ReactNode, props) = > ReactNode
. After trying to use it, it is found that the following redundant codeconsole.log ()
must be included in the element to take effect, as follows - has considered writing extra elements in a function component and passing props; to prevent time bubbles; checking to see if there are previous attributes in API that can be controlled, and so on.
-
guess that may be when clicking, unless you click on one of the
Option
options, the rest of the click is the event of the hidden drop-down box that is called, that is, the hidden event of the drop-down box prevents the event written by yourself.
-< / td >
< / tr > < / tbody >
< / table >