mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
* Fix: Affix target add listeners protect (#45291) * Update components/affix/index.tsx Co-authored-by: afc163 <afc163@gmail.com> Signed-off-by: lijianan <574980606@qq.com> --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: lijianan <574980606@qq.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
bce43064ff
commit
73c0cd7b49
@ -197,6 +197,9 @@ const InternalAffix = React.forwardRef<AffixRef, InternalAffixProps>((props, ref
|
||||
|
||||
const addListeners = () => {
|
||||
const listenerTarget = targetFunc?.();
|
||||
if (!listenerTarget) {
|
||||
return;
|
||||
}
|
||||
TRIGGER_EVENTS.forEach((eventName) => {
|
||||
if (prevListener.current) {
|
||||
prevTarget.current?.removeEventListener(eventName, prevListener.current);
|
||||
|
Loading…
Reference in New Issue
Block a user