Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Not trigger enter open for portal element #442

Merged
merged 3 commits into from
Jan 25, 2024
Merged

fix: Not trigger enter open for portal element #442

merged 3 commits into from
Jan 25, 2024

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jan 24, 2024

tests/portal.test.jsx Fixed Show fixed Hide fixed
tests/portal.test.jsx Fixed Show fixed Hide fixed
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b2a4124) 97.74% compared to head (b68fc99) 97.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #442      +/-   ##
==========================================
+ Coverage   97.74%   97.87%   +0.13%     
==========================================
  Files          13       13              
  Lines         797      799       +2     
  Branches      224      226       +2     
==========================================
+ Hits          779      782       +3     
+ Misses         18       17       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import React, { createRef, StrictMode } from 'react';
import ReactDOM from 'react-dom';
import Trigger from '../src';
import { awaitFakeTimer, placementAlignMap } from './util';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { awaitFakeTimer, placementAlignMap } from './util';
import { placementAlignMap } from './util';

if (mergedOpen || inMotion) {
if (
(mergedOpen || inMotion) &&
popupEle?.contains(event.target as HTMLElement)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

popupEle 不存在会是什么场景?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

防止别人手工去调用 onMouseEnter,防御性的。

@zombieJ zombieJ merged commit df60150 into master Jan 25, 2024
9 checks passed
@zombieJ zombieJ deleted the lazy branch January 25, 2024 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

【Modal Dropdown】Dropdown配合下拉菜单打开Modal后,触发Dropdown菜单重新浮现
2 participants